Editing
網路服務連線測試
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 如何連線到網路服務 (Web 服務) === 如果服務是網站伺服器 (web service): * (1) 打開瀏覽器,(2) 輸入地址:{{kbd | key = <nowiki>http://127.0.0.1</nowiki> }} 或 {{kbd | key =<nowiki>http://the.domain</nowiki>}} * Linux Lynx 指令: *# (如果尚未安裝lynx,則為可選操作) {{kbd | key = <nowiki>yum install lynx</nowiki>}} 適用於CentOS / {{kbd | key = <nowiki>sudo apt-get install lynx</nowiki>}} 適用於Ubuntu<ref>[http://www.addictivetips.com/ubuntu-linux-tips/install-and-use-lynx-on-ubuntu/ 在Ubuntu上安裝和使用Lynx瀏覽器]</ref> *# {{kbd | key = <nowiki>lynx http://127.0.0.1</nowiki>}} <ref>[http://lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx_help/Lynx_users_guide.html Lynx使用者指南 v2.8.7]</ref> 適用於{{Linux}} * telnet 指令 *# {{kbd | key = telnet 127.0.0.1 <PORT>}} 例如 {{kbd | key = telnet 127.0.0.1 80}} 或 {{kbd | key = telnet the.domain 80}} *# (在telnet連接80埠後,輸入) {{kbd_plus | key1 = get | key2 = SPACE}}<ref>[http://www.simplescripts.de/http-check-port-80-telnet-command.htm 使用Telnet指令檢查HTTP埠口80]</ref> * curl<ref>[https://curl.se/docs/manpage.html curl - 使用方法]</ref>: {{kbd | key = <nowiki>curl -vL http://IP:Port</nowiki>}} ** (如果尚未安裝curl指令,則為可選操作) [https://help.ubidots.com/en/articles/2165289-learn-how-to-install-run-curl-on-windows-macosx-linux 在Windows/MacOSX/Linux上安裝和運行cURL | Ubidots幫助中心] ** 指令範例: *** (1) 使用 {{kbd | key = <nowiki>curl -voL https://www.google.com</nowiki>}} 將輸出寫入<file>而非stdout *** (2) 使用 {{kbd | key = <nowiki>curl -vL https://www.google.com</nowiki>}} 或 {{kbd | key = <nowiki>curl -voL /dev/null https://www.google.com</nowiki>}} 將輸出寫入stdout *** (3) 使用 {{kbd | key = <nowiki>curl -vOL https://www.google.com/index.html</nowiki>}} 將輸出寫入<file>並使用遠程檔案名 ** 如果失敗,將顯示消息:"failed: Connection refused" * Linux [https://www.gnu.org/software/wget/ wget] 軟體例如 {{kbd | key = <nowiki>wget https://www.google.com</nowiki>}} * 使用第三方網站監控服務:[[Web Ping]] 如果服務不是網站伺服器,則使用telnet # (可選) [https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771275(v=ws.10) 在{{Win}}上安裝Telnet用戶端 | Microsoft文件]。[https://medium.com/@blackSource/bring-telnet-back-on-macos-high-sierra-11de98de1544 在macOS high Sierra上重啟telnet – Ayuth Mangmesap (blackSource) – Medium] 在{{Mac}} # {{kbd | key = telnet 127.0.0.1 <PORT>}} 如果連接網頁服務失敗。它將顯示消息:"telnet: 無法連接到遠程主機:連接被拒絕" 如果安裝了 Python 或 Node.js,則可使用替代網站服務 * (適用 python 3.x) {{kbd | key=<nowiki>python -m http.server <port></nowiki>}} (預設 port: 8000)<ref>[https://docs.python.org/3/library/http.server.html http.server — HTTP servers — Python 3.13.2 documentation]</ref> * (適用 Node.js) {{kbd | key=<nowiki>npx http-server -p <port></nowiki>}} (預設 port: 8080)<ref>[https://github.com/http-party/http-server http-server: a simple static HTTP server]</ref>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information