http.server
http.server — HTTP servers
Source code: Lib/http/server.py
This module defines classes for implementing HTTP servers (Web servers).
One class, HTTPServer
, is a socketserver.TCPServer
subclass. It creates and listens at the HTTP socket, dispatching the requests to a handler. Code to create and run the server looks like this:
def run(server_class=HTTPServer, handler_class=BaseHTTPRequestHandler): server_address = ('', 8000) httpd = server_class(server_address, handler_class) httpd.ser