socktools.examples.simple_http¶
Overview¶
This module demonstrates a trivial webserver using the http_mixin module. Please note that it is NOT considered production-ready.
Python API¶
This module implements a toy http webserver where every URL returns a small HTML page.
-
class
socktools.examples.simple_http.MyServer(bind=None, connect=None, handlers={}, timeout=10, tick_interval=0.25, sock=None, meta_sock=None, logger=None, no_async=False)[source]¶ Bases:
socktools.http_mixin.HTTPMixin,socktools.tcp_sock.TCPSockSimple http server
This class implements a trivial http server with some static content.
Note that unlike other protocols and sockets, when dealing with HTTP the msg_data object has a reply() method that must be used.