When I try to run the code below, the mac refuse the connection.
from http.server import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
message = "Welcome to COE 550!"
self.protocol_version = "HTTP/1.1"
self.send_response(200)
self.send_header("Content-Length",len(message))
self.end_headers()
self.wfile.write(bytes(message, "utf8"))
return
server = ('localhost', 80)
httpd = HTTPServer(server, RequestHandler)
httpd.serve_forever()
The output message is
PermissionError: [Errno 13] Permission denied