HTTP web server based on epoll event-loop using non-blocking sockets. In addition to I/O events, the server also does generic callback handling and schedule time-based events.
Bases: pluggdapps.plugin.Plugin
A non-blocking, single-threaded HTTP Server plugin. HTTPEPollServer can serve SSL traffic with Python 2.6+ and OpenSSL. To make this server serve SSL traffic, configure this plugin with ssl.* settings which is required for the ssl.wrap_socket method, including “certfile” and “keyfile”.
Server resolves application for HTTP requests and dispatches them to corresponding IWebApp plugin. Finishing the request does not necessarily close the connection in the case of HTTP/1.1 keep-alive requests.
IOLoop instance for event-polling.
pluggdapps.interfaces.IHTTPServer.start() interface method.
Stop listening for new connections. Expected to be called in case of exceptions and SIGNALS. Refer pluggdapps.interfaces.IHTTPServer.start() interface method.
pluggdapps.interfaces.IHTTPServer.close_connection() interface method.
Bases: pluggdapps.plugin.Plugin
IHTTPConnection plugin to handle http connections. Every client connection corresponds to an instance of this plugin, handle request, parse headers and bodies, and execute the request callback and writes the response back.
Accepts only HTTP/1.1 request. If otherwise, reponds with bad-request (400) and closes the connection.
Call-back for writing data to connection.
Call-back when connection is closed.
Call-back when request is finished.
Tuple of new request’s start line and headers, (method, uri, version, hdrs)
Tuple of on-going request chunk, (chunk_size, chunk_ext, chunk_data)
IOStream object.
Connection timeout from ioloop.
pluggdapps.interfaces.IHTTPConnection.get_ssl_certificate() interface method.
pluggdapps.interfaces.IHTTPConnection.set_close_callback() interface method.
pluggdapps.interfaces.IHTTPConnection.set_finish_callback() interface method.
pluggdapps.interfaces.IHTTPConnection.handle_request() interface method.
pluggdapps.interfaces.IHTTPConnection.handle_chunk() interface method.
pluggdapps.interfaces.IHTTPConnection.close() interface method.
Adds an IOLoop event handler to accept new connections on sock. When a connection is accepted, callback(connection, address) will be run (connection is a socket object, and address is the address of the other end of the connection). Note that this signature is different from the callback(fd, events) signature used for IOLoop handlers.