小编rba*_*ber的帖子

Http request from Chrome hangs python webserver

I have a very basic python (2.7.12) web server (I've stripped it down as much as possible), code given below

import time
import ssl
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler

class Management(SimpleHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)
        SimpleHTTPRequestHandler.end_headers(self)
        self.wfile.write(time.asctime() + "\n")

httpd = HTTPServer(('', 4443), Management)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./server.pem', server_side=True)
httpd.serve_forever()
Run Code Online (Sandbox Code Playgroud)

All it does is return the time. It works fine when I access it via https, but when I access it via http using (the latest version …

google-chrome pyopenssl python-2.7 python-3.x

5
推荐指数
2
解决办法
1778
查看次数

标签 统计

google-chrome ×1

pyopenssl ×1

python-2.7 ×1

python-3.x ×1