1 """Manage HTTP servers with CherryPy."""
2
3 import warnings
4
5 import cherrypy
6 from cherrypy.lib import attributes
7
8
9
10 from cherrypy.process.servers import *
11
12
14 """An adapter for an HTTP server.
15
16 You can set attributes (like socket_host and socket_port)
17 on *this* object (which is probably cherrypy.server), and call
18 quickstart. For example:
19
20 cherrypy.server.socket_port = 80
21 cherrypy.quickstart()
22 """
23
24 socket_port = 8080
25
26 _socket_host = '127.0.0.1'
30 if not value:
31 raise ValueError("Host values of '' or None are not allowed. "
32 "Use '0.0.0.0' instead to listen on all active "
33 "interfaces (INADDR_ANY).")
34 self._socket_host = value
35 socket_host = property(_get_socket_host, _set_socket_host,
36 doc="""The hostname or IP address on which to listen for connections.
37
38 Host values may be any IPv4 or IPv6 address, or any valid hostname.
39 The string 'localhost' is a synonym for '127.0.0.1' (or '::1', if
40 your hosts file prefers IPv6). The string '0.0.0.0' is a special
41 IPv4 entry meaning "any active interface" (INADDR_ANY), and '::'
42 is the similar IN6ADDR_ANY for IPv6. The empty string or None are
43 not allowed.""")
44
45 socket_file = ''
46 socket_queue_size = 5
47 socket_timeout = 10
48 shutdown_timeout = 5
49 protocol_version = 'HTTP/1.1'
50 reverse_dns = False
51 thread_pool = 10
52 thread_pool_max = -1
53 max_request_header_size = 500 * 1024
54 max_request_body_size = 100 * 1024 * 1024
55 instance = None
56 ssl_certificate = None
57 ssl_private_key = None
58 nodelay = True
59
62
64 """This does nothing now and will be removed in 3.2."""
65 warnings.warn('quickstart does nothing now and will be removed in '
66 '3.2. Call cherrypy.engine.start() instead.',
67 DeprecationWarning)
68
85
91 start.priority = 75
92
118