網路服務連線測試: Difference between revisions

Jump to navigation Jump to search
m (Text replacement - ": Image:Owl icon.jpg " to "{{Tips}} ")
Tags: Mobile edit Mobile web edit
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
如何測試與排除網路服務連線問題。找出問題發生的地方:(1) 伺服器上的本地服務 (localhost) (2) 從區域網路到伺服器 (3) 從廣域網路到伺服器
如何測試與排除網路服務連線問題。找出問題發生的地方:(1) 伺服器上的本地服務 (localhost) (2) 從區域網路到伺服器 (3) 從廣域網路到伺服器


: [[Test connectivity for the web service]] in English
{{LanguageSwitcher | content = [[Test connectivity for the web service | EN]], [[網路服務連線測試 | 漢字]] }}


=== 如何連線到網路服務 (Web 服務) ===
=== 如何連線到網路服務 (Web 服務) ===
Line 32: Line 32:
# {{kbd | key = telnet 127.0.0.1 <PORT>}} 如果連接網頁服務失敗。它將顯示消息:"telnet: 無法連接到遠程主機:連接被拒絕"
# {{kbd | key = telnet 127.0.0.1 <PORT>}} 如果連接網頁服務失敗。它將顯示消息:"telnet: 無法連接到遠程主機:連接被拒絕"


如果安裝了Python,則使用替代網站服務
如果安裝了 Python 或 Node.js,則可使用替代網站服務


* (對於python 2.x) {{kbd | key=<nowiki>python -m SimpleHTTPServer <port></nowiki>}}<ref>[https://docs.python.org/2/library/simplehttpserver.html 20.19. SimpleHTTPServer 簡單HTTP請求處理器 — Python 2.7.17 文件]</ref>
* (適用 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>
* (對於python 3.x) {{kbd | key=<nowiki>python -m http.server <port></nowiki>}}<ref>[https://docs.python.org/3.8/library/http.server.html?highlight=http%20server#module-http.server http.server — HTTP伺服器 — Python 3.8.1 文件]</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>


== 測試本地網路服務的連接性 ==
== 測試本地網路服務的連接性 ==

Navigation menu