class_docstr: 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.SSLContext.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(application, 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`: single-process::
  
          async def main():
              server = HTTPServer()
              server.listen(8888)
              await asyncio.Event.wait()
  
          asyncio.run(main())
  
     In many cases, `tornado.web.Application.listen` can be used to avoid
     the need to explicitly create the `HTTPServer`.
  
     While this example does not create multiple processes on its own, when
     the ``reuse_port=True`` argument is passed to ``listen()`` you can run
     the program multiple times to create a multi-process service.
  
  2. `~tornado.tcpserver.TCPServer.add_sockets`: multi-process::
  
          sockets = bind_sockets(8888)
          tornado.process.fork_processes(0)
          async def post_fork_main():
              server = HTTPServer()
              server.add_sockets(sockets)
              await asyncio.Event().wait()
          asyncio.run(post_fork_main())
  
     The ``add_sockets`` interface is more complicated, but it can be used with
     `tornado.process.fork_processes` to run a multi-process service with all
     worker processes forked from a single parent.  ``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`.
  
     Note that when using this pattern, nothing that touches the event loop
     can be run before ``fork_processes``.
  
  3. `~tornado.tcpserver.TCPServer.bind`/`~tornado.tcpserver.TCPServer.start`:
     simple **deprecated** multi-process::
  
          server = HTTPServer()
          server.bind(8888)
          server.start(0)  # Forks multiple sub-processes
          IOLoop.current().start()
  
     This pattern is deprecated because it requires interfaces in the
     `asyncio` module that have been deprecated since Python 3.10. Support for
     creating multiple processes in the ``start`` method will be removed in a
     future version of Tornado.
  
  .. 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.
  
  .. versionchanged:: 5.0
     The ``io_loop`` argument has been removed.
class_docstr_tok: ["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.SSLContext.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","(","application",",","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","`",":","single-process",":",":","async","def","main","(",")",":","server","=","HTTPServer","(",")","server.listen","(","8888",")","await","asyncio.Event.wait","(",")","asyncio.run","(","main","(",")",")","In","many","cases",",","`","tornado.web.Application.listen","`","can","be","used","to","avoid","the","need","to","explicitly","create","the","`","HTTPServer","`",".","While","this","example","does","not","create","multiple","processes","on","its","own",",","when","the","``","reuse_port=True","``","argument","is","passed","to","``","listen","(",")","``","you","can","run","the","program","multiple","times","to","create","a","multi-process","service",".","2",".","`","~tornado.tcpserver.TCPServer.add_sockets","`",":","multi-process",":",":","sockets","=","bind_sockets","(","8888",")","tornado.process.fork_processes","(","0",")","async","def","post_fork_main","(",")",":","server","=","HTTPServer","(",")","server.add_sockets","(","sockets",")","await","asyncio.Event","(",")",".wait","(",")","asyncio.run","(","post_fork_main","(",")",")","The","``","add_sockets","``","interface","is","more","complicated",",","but","it","can","be","used","with","`","tornado.process.fork_processes","`","to","run","a","multi-process","service","with","all","worker","processes","forked","from","a","single","parent",".","``","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","`",".","Note","that","when","using","this","pattern",",","nothing","that","touches","the","event","loop","can","be","run","before","``","fork_processes","``",".","3",".","`","~tornado.tcpserver.TCPServer.bind","`","\/","`","~tornado.tcpserver.TCPServer.start","`",":","simple","*","*","deprecated","*","*","multi-process",":",":","server","=","HTTPServer","(",")","server.bind","(","8888",")","server.start","(","0",")","#","Forks","multiple","sub-processes","IOLoop.current","(",")",".start","(",")","This","pattern","is","deprecated","because","it","requires","interfaces","in","the","`","asyncio","`","module","that","have","been","deprecated","since","Python","3.10",".","Support","for","creating","multiple","processes","in","the","``","start","``","method","will","be","removed","in","a","future","version","of","Tornado",".","..","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",".","..","versionchanged",":",":","5.0","The","``","io_loop","``","argument","has","been","removed","."]
code: def initialize(
      self,
      request_callback: Union[
          httputil.HTTPServerConnectionDelegate,
          Callable[[httputil.HTTPServerRequest], None],
      ],
      no_keep_alive: bool = False,
      xheaders: bool = False,
      ssl_options: Optional[
          Union[Dict[str, Any], ssl.SSLContext]
      ] = None,
      protocol: Optional[str] = None,
      decompress_request: bool = False,
      chunk_size: Optional[int] = None,
      max_header_size: Optional[int] = None,
      idle_connection_timeout: Optional[float] = None,
      body_timeout: Optional[float] = None,
      max_body_size: Optional[int] = None,
      max_buffer_size: Optional[int] = None,
      trusted_downstream: Optional[List[str]] = None,
  ) -> None:
      # This method's signature is not extracted with autodoc
      # because we want its arguments to appear on the class
      # constructor. When changing this signature, also update the
      # copy in httpserver.rst.
      self.request_callback = request_callback
      self.xheaders = xheaders
      self.protocol = protocol
      self.conn_params = HTTP1ConnectionParameters(
          decompress=decompress_request,
          chunk_size=chunk_size,
          max_header_size=max_header_size,
          header_timeout=idle_connection_timeout or 3600,
          max_body_size=max_body_size,
          body_timeout=body_timeout,
          no_keep_alive=no_keep_alive,
      )
      TCPServer.__init__(
          self,
          ssl_options=ssl_options,
          max_buffer_size=max_buffer_size,
          read_chunk_size=chunk_size,
      )
      self._connections = set()  # type: Set[HTTP1ServerConnection]
      self.trusted_downstream = trusted_downstream
  
imports: import socket
  import ssl
  from tornado.escape import native_str
  from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
  from tornado import httputil
  from tornado import iostream
  from tornado import netutil
  from tornado.tcpserver import TCPServer
  from tornado.util import Configurable
  import typing
  from typing import Union, Any, Dict, Callable, List, Type, Tuple, Optional, Awaitable
label_desc: Use image node_id 2 for calling the HTTPServer obj's underlying member method code with example usage: obj.initialize(request_callback, no_keep_alive, xheaders, ssl_options, protocol, decompress_request, chunk_size, max_header_size, idle_connection_timeout, body_timeout, max_body_size, max_buffer_size, trusted_downstream) without return types