一個設定位址的問題

看板Python作者時間13年前 (2012/12/04 03:17), 編輯推噓0(006)
留言6則, 5人參與, 最新討論串1/2 (看更多)
各位大大 問題是這樣的 我是用深入淺出的範例在我自己的電腦上弄一個簡單的web伺服器,是在python3.2下跑的 程式碼如下: from http.server import HTTPServer, CGIHTTPRequestHandler port = 8080 httpd = HTTPServer(('', port), CGIHTTPRequestHandler) print("Starting simple_httpd on port: " + str(httpd.server_port)) httpd.serve_forever() 我現在有一個問題是 我是在某一個固定ip後面分出去的電腦 例如: 140.112.56.84 被網管指定的port是3388 我的ip格式要怎麼打才能存取到預設的index.html阿? http://140.112.56.84/??? ※ 編輯: left 來自: 140.112.217.224 (12/04 03:49)

12/04 10:04, , 1F
140.112.56.84:3388
12/04 10:04, 1F

12/04 17:13, , 2F
前提是 localhost:8080 被 forward 到 140.112.56.84:3388
12/04 17:13, 2F

12/04 17:16, , 3F
或是乾脆你就用 3388 不要用 8080 就好了
12/04 17:16, 3F

12/05 11:01, , 4F
同上.. 不會用proxy 就 直接用 3388 port 來開server = =
12/05 11:01, 4F

12/06 11:07, , 5F
本機連自己 http:/127.0.0.1:8080
12/06 11:07, 5F

12/06 11:09, , 6F
非本機 請設定port=80 然後用http://140.112.56.84:3388
12/06 11:09, 6F
文章代碼(AID): #1GlFhEzT (Python)
討論串 (同標題文章)
文章代碼(AID): #1GlFhEzT (Python)