circuits.web.servers module¶
Web Servers
This module implements the several Web Server components.
- class circuits.web.servers.BaseServer(*args, **kwargs)¶
Bases:
BaseComponent
Create a Base Web Server
Create a Base Web Server (HTTP) bound to the IP Address / Port or UNIX Socket specified by the ‘bind’ parameter.
- Variables
server – Reference to underlying Server Component
- Parameters
bind (Instance of int, list, tuple or str) – IP Address / Port or UNIX Socket to bind to.
The ‘bind’ parameter is quite flexible with what valid values it accepts.
If an int is passed, a TCPServer will be created. The Server will be bound to the Port given by the ‘bind’ argument and the bound interface will default (normally to “0.0.0.0”).
If a list or tuple is passed, a TCPServer will be created. The Server will be bound to the Port given by the 2nd item in the ‘bind’ argument and the bound interface will be the 1st item.
If a str is passed and it contains the ‘:’ character, this is assumed to be a request to bind to an IP Address / Port. A TCpServer will thus be created and the IP Address and Port will be determined by splitting the string given by the ‘bind’ argument.
Otherwise if a str is passed and it does not contain the ‘:’ character, a file path is assumed and a UNIXServer is created and bound to the file given by the ‘bind’ argument.
x.__init__(…) initializes x; see x.__class__.__doc__ for signature
- channel = 'web'¶
- property host¶
- property port¶
- property display_banner¶
- property secure¶
- class circuits.web.servers.Server(*args, **kwargs)¶
Bases:
BaseServer
Create a Web Server
Create a Web Server (HTTP) complete with the default Dispatcher to parse requests and posted form data dispatching to appropriate Controller(s).
See: circuits.web.servers.BaseServer
x.__init__(…) initializes x; see x.__class__.__doc__ for signature