Error 10013 HTTP Server
Solved
robjo82
-
robjo82 -
robjo82 -
Hello,
I've been trying for a few days to create an HTTP server with Python, but when I run it, I get the following error:
My code is as follows:
What should I do? Thank you in advance for your responses
Configuration: Windows / Chrome 71.0.3578.98
I've been trying for a few days to create an HTTP server with Python, but when I run it, I get the following error:
Traceback (most recent call last):
File "http-server.py", line 12, in <module>
httpd = server(address, handler)
File "C:\Users\Robin\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 456, in __init__
self.server_bind()
File "C:\Users\Robin\AppData\Local\Programs\Python\Python36\lib\http\server.py", line 136, in server_bind
socketserver.TCPServer.server_bind(self)
File "C:\Users\Robin\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 470, in server_bind
self.socket.bind(self.server_address)
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
My code is as follows:
#coding:utf-8
import http.server
port = 80
address = ("", port)
server = http.server.HTTPServer
handler = http.server.CGIHTTPRequestHandler
handler.cgi_directories = ["/"]
httpd = server(address, handler)
print ("Server started on port", port)
httpd.serve_forever()
What should I do? Thank you in advance for your responses
Configuration: Windows / Chrome 71.0.3578.98