Integrating SimpleHTTPServer into asyncore
Ng Pheng Siong
ngps at madcap.dyndns.org
Mon Jul 9 11:39:23 EDT 2001
According to Erik Max Francis <max at alcyone.com>:
> Is there a standard way to integrate SimpleHTTPServer (and related
> classes) into the asyncore poll loop, or is it just the rather obvious
> process of creating a dispatcher that containers a SimpleHTTPServer and
> delegates all the relevant asyncore methods to SimpleHTTPServer?
Just use Medusa's http_server. Medusa does HTTP/1.1 with persistent
connections; SimpleHTTPServer (really BaseHTTPRequestHandler) does
HTTP/1.0 only.
Some refactoring of Medusa and/or BaseHTTPRequestHandler to simplify
writing HTTP method (GET, POST, etc.) handlers that are portable to both
would be nice; e.g., send_header(), end_headers() versus Medusa's
http_response object.
--
Ng Pheng Siong <ngps at post1.com> * http://www.post1.com/home/ngps
Quidquid latine dictum sit, altum viditur.
More information about the Python-list
mailing list