golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
378 B
Del
OK
_locale_data.cpython-310.pyc
3.23 KB
Del
OK
auth.cpython-310.pyc
39.18 KB
Del
OK
autoreload.cpython-310.pyc
7.02 KB
Del
OK
concurrent.cpython-310.pyc
17.24 KB
Del
OK
curl_httpclient.cpython-310.pyc
12.8 KB
Del
OK
escape.cpython-310.pyc
9.89 KB
Del
OK
gen.cpython-310.pyc
38.39 KB
Del
OK
http1connection.cpython-310.pyc
19.47 KB
Del
OK
httpclient.cpython-310.pyc
25.19 KB
Del
OK
httpserver.cpython-310.pyc
11.45 KB
Del
OK
httputil.cpython-310.pyc
29.84 KB
Del
OK
ioloop.cpython-310.pyc
33.19 KB
Del
OK
iostream.cpython-310.pyc
42.97 KB
Del
OK
locale.cpython-310.pyc
15.22 KB
Del
OK
locks.cpython-310.pyc
16.61 KB
Del
OK
log.cpython-310.pyc
8.07 KB
Del
OK
netutil.cpython-310.pyc
14.32 KB
Del
OK
options.cpython-310.pyc
19.63 KB
Del
OK
process.cpython-310.pyc
10.27 KB
Del
OK
queues.cpython-310.pyc
11.29 KB
Del
OK
routing.cpython-310.pyc
21.08 KB
Del
OK
simple_httpclient.cpython-310.pyc
16.08 KB
Del
OK
stack_context.cpython-310.pyc
10.65 KB
Del
OK
tcpclient.cpython-310.pyc
6.49 KB
Del
OK
tcpserver.cpython-310.pyc
10.06 KB
Del
OK
template.cpython-310.pyc
30.52 KB
Del
OK
testing.cpython-310.pyc
24.61 KB
Del
OK
util.cpython-310.pyc
13.72 KB
Del
OK
web.cpython-310.pyc
105.22 KB
Del
OK
websocket.cpython-310.pyc
39.08 KB
Del
OK
wsgi.cpython-310.pyc
11.5 KB
Del
OK
Edit: httpserver.cpython-310.pyc
o �xe@2 � @ s� d Z ddlmZmZmZ ddlZddlmZ ddlm Z m Z ddlmZ ddlm Z ddlmZ dd lmZ dd lmZ ddlmZ G dd � d eee j�ZG dd� de j�ZG dd� de�ZG dd� de j�Ze jZdS )a� A non-blocking, single-threaded HTTP server. Typical applications have little direct interaction with the `HTTPServer` class except to start a server at the beginning of the process (and even that is often done indirectly via `tornado.web.Application.listen`). .. versionchanged:: 4.0 The ``HTTPRequest`` class that used to live in this module has been moved to `tornado.httputil.HTTPServerRequest`. The old name remains as an alias. � )�absolute_import�division�print_functionN)� native_str)�HTTP1ServerConnection�HTTP1ConnectionParameters)�gen)�httputil)�iostream)�netutil)� TCPServer)�Configurablec @ sn e Zd ZdZdd� Z ddd�Zedd � �Zed d� �Ze j dd � �Zdd� Zdd� Z dd� ZdS )� HTTPServeraK A non-blocking, single-threaded HTTP server. A server is defined by a subclass of `.HTTPServerConnectionDelegate`, or, for backwards compatibility, a callback that takes an `.HTTPServerRequest` as an argument. The delegate is usually a `tornado.web.Application`. `HTTPServer` supports keep-alive connections by default (automatically for HTTP/1.1, or for HTTP/1.0 when the client requests ``Connection: keep-alive``). If ``xheaders`` is ``True``, we support the ``X-Real-Ip``/``X-Forwarded-For`` and ``X-Scheme``/``X-Forwarded-Proto`` headers, which override the remote IP and URI scheme/protocol for all requests. These headers are useful when running Tornado behind a reverse proxy or load balancer. The ``protocol`` argument can also be set to ``https`` if Tornado is run behind an SSL-decoding proxy that does not set one of the supported ``xheaders``. By default, when parsing the ``X-Forwarded-For`` header, Tornado will select the last (i.e., the closest) address on the list of hosts as the remote host IP address. To select the next server in the chain, a list of trusted downstream hosts may be passed as the ``trusted_downstream`` argument. These hosts will be skipped when parsing the ``X-Forwarded-For`` header. To make this server serve SSL traffic, send the ``ssl_options`` keyword argument with an `ssl.SSLContext` object. For compatibility with older versions of Python ``ssl_options`` may also be a dictionary of keyword arguments for the `ssl.wrap_socket` method.:: ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_ctx.load_cert_chain(os.path.join(data_dir, "mydomain.crt"), os.path.join(data_dir, "mydomain.key")) HTTPServer(applicaton, ssl_options=ssl_ctx) `HTTPServer` initialization follows one of three patterns (the initialization methods are defined on `tornado.tcpserver.TCPServer`): 1. `~tornado.tcpserver.TCPServer.listen`: simple single-process:: server = HTTPServer(app) server.listen(8888) IOLoop.current().start() In many cases, `tornado.web.Application.listen` can be used to avoid the need to explicitly create the `HTTPServer`. 2. `~tornado.tcpserver.TCPServer.bind`/`~tornado.tcpserver.TCPServer.start`: simple multi-process:: server = HTTPServer(app) server.bind(8888) server.start(0) # Forks multiple sub-processes IOLoop.current().start() When using this interface, an `.IOLoop` must *not* be passed to the `HTTPServer` constructor. `~.TCPServer.start` will always start the server on the default singleton `.IOLoop`. 3. `~tornado.tcpserver.TCPServer.add_sockets`: advanced multi-process:: sockets = tornado.netutil.bind_sockets(8888) tornado.process.fork_processes(0) server = HTTPServer(app) server.add_sockets(sockets) IOLoop.current().start() The `~.TCPServer.add_sockets` interface is more complicated, but it can be used with `tornado.process.fork_processes` to give you more flexibility in when the fork happens. `~.TCPServer.add_sockets` can also be used in single-process servers if you want to create your listening sockets in some way other than `tornado.netutil.bind_sockets`. .. versionchanged:: 4.0 Added ``decompress_request``, ``chunk_size``, ``max_header_size``, ``idle_connection_timeout``, ``body_timeout``, ``max_body_size`` arguments. Added support for `.HTTPServerConnectionDelegate` instances as ``request_callback``. .. versionchanged:: 4.1 `.HTTPServerConnectionDelegate.start_request` is now called with two arguments ``(server_conn, request_conn)`` (in accordance with the documentation) instead of one ``(request_conn)``. .. versionchanged:: 4.2 `HTTPServer` is now a subclass of `tornado.util.Configurable`. .. versionchanged:: 4.5 Added the ``trusted_downstream`` argument. c O s d S �N� )�self�args�kwargsr r �O/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/httpserver.py�__init__� s zHTTPServer.__init__FNc C sZ || _ || _|| _|| _t||| | pd|||d�| _tj| ||| |d� t� | _ || _ d S )Ni )� decompress� chunk_size�max_header_sizeZheader_timeout� max_body_size�body_timeout� no_keep_alive)�io_loop�ssl_options�max_buffer_sizeZread_chunk_size)�request_callbackr �xheaders�protocolr �conn_paramsr r �set�_connections�trusted_downstream)r r r r r r r! Zdecompress_requestr r Zidle_connection_timeoutr r r r% r r r � initialize� s&