httpserver package¶
Submodules¶
httpserver.httpserver module¶
-
class
httpserver.httpserver.
HttpProtocol
(host, folder, event_loop=None, timeout=15)[source]¶ Bases:
asyncio.protocols.Protocol
HTTP/1.1 Protocol implementation
Per connection made, one of these gets instantiated
Module contents¶
-
httpserver.
run
(argv=None)[source]¶ Run the HTTP server
- Usage:
- httpserver [options] [<folder>]
Options:
-h,--host=<hostname> What host name to serve (default localhost) -a,--bindaddress=<address> Address to bind to (default 127.0.0.1) -p,--port=<port> Port to listen on (default 8080) -v,--verbose Increase verbosity to INFO messages -d,--debug Increase verbosity to DEBUG messages --help Print this help message --version Print the version
To serve /path/to/www on all (ipv4) addresses for host myserver on port 80:
httpserver -a 0.0.0.0 -p 80 -h myserver /path/to/www