K i° ddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z m Z mZmZddlmZddlmZmZmZmZddlmZddlmZmZmZdd lmZmZm Z m!Z!m"Z"m#Z#dd l$m%Z%m&Z&dd l'm(Z(dd l)m*Z*m+Z+m,Z,m-Z-dd l.m/Z/ddl0m1Z1ddlm2Z2m3Z3m4Z4m5Z5m6Z6ddlm7Z7ddl8m9Z9m:Z:ddlm;Z;ddl0meeee?egeffZ@eAe5eeBfZCGdde<ZDGddZEGddZFeFZG d ddZH d dZIy)!) annotationsN) Awaitable GeneratorIterableSequence) TracebackType)AnyCallableUnioncast)asyncio_timeout)Headers HeadersLikeMultipleValuesError)InvalidHandshake InvalidHeaderInvalidMessage InvalidOriginInvalidUpgradeNegotiationError) ExtensionServerExtensionFactory) enable_server_permessage_deflate)build_extensionparse_extensionparse_subprotocolvalidate_subprotocols)SERVER)State)ExtensionHeader LoggerLikeOrigin StatusLike Subprotocol)AbortHandshake)build_response check_request) read_request)WebSocketCommonProtocol broadcast)r,serve unix_serveWebSocketServerProtocolWebSocketServerc HeZdZdZdZdZdddddedddd dfdZdfd Zdd Z dd Z d dd Z dd Z e d dd Ze ddZ ddZ ddZ d ddZxZS)r/a WebSocket server connection. :class:`WebSocketServerProtocol` provides :meth:`recv` and :meth:`send` coroutines for receiving and sending messages. It supports asynchronous iteration to receive messages:: async for message in websocket: await process(message) The iterator exits normally when the connection is closed with close code 1000 (OK) or 1001 (going away) or without a close code. It raises a :exc:`~websockets.exceptions.ConnectionClosedError` when the connection is closed with any other code. You may customize the opening handshake in a subclass by overriding :meth:`process_request` or :meth:`select_subprotocol`. Args: ws_server: WebSocket server that created this connection. See :func:`serve` for the documentation of ``ws_handler``, ``logger``, ``origins``, ``extensions``, ``subprotocols``, ``extra_headers``, and ``server_header``. See :class:`~websockets.legacy.protocol.WebSocketCommonProtocol` for the documentation of ``ping_interval``, ``ping_timeout``, ``close_timeout``, ``max_size``, ``max_queue``, ``read_limit``, and ``write_limit``. FserverN ) loggerorigins extensions subprotocols extra_headers server_headerprocess_requestselect_subprotocol open_timeoutc  j|tjd}t| dd|i| |4d|vr0t j dt |D cgc] } | dk(rdn|  }} t||_||_ ||_ ||_ ||_ ||_ ||_| |_| |_| |_ycc} w)Nwebsockets.serverr4z!use None instead of '' in origins)logging getLoggersuper__init__warningswarnDeprecationWarningremove_path_argument ws_handler ws_serverr5available_extensionsavailable_subprotocolsr8r9_process_request_select_subprotocolr<)selfrIrJr4r5r6r7r8r9r:r;r<kwargsorigin __class__s ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/websockets/legacy/server.pyrDz WebSocketServerProtocol.__init__\s0 >&&':;F 11&1  2= MM=?Q RFMNFv|t7NGN/z:" $.!&2#** /#5 (OsB0ct|||jj||jj |j |_y)zJ Register connection and initialize a task to handle it. N)rCconnection_maderJregisterloop create_taskhandler handler_task)rO transportrRs rSrUz'WebSocketServerProtocol.connection_madesC  * % II11$,,.Ac  K t|j4d{|j|j|j|j |j d{dddd{ |j_|d{ |jed{ |jZj]||j$jSdy777s#1d{7swYxYw#tj$rt$rt$rO}t|tr&|j|j|j}}}nt|t rc|j"r|j$j#ddt&j(j*t-d|dj/}}}nit|t0rd|j"r|j$j#ddt&j(j2t-d gd|d j/}}}nt|t4r|j"r|j$j#d dt7t8|}|}|j:!|j:}|d |z }|j:!t&j(j<t-d|dj/}}}nC|j$j?d dt&j(j@t-d}}}|jCdtDjFjId|jJr|jCd|jJ|jCdtMtO||jCdd|jCdd|jQ||||j$jSd|jT|jV|jYd{7Yd}~|jZj]||j$jSdyd}~wwxYw7#t$r<|j$j?dd|j`s|jcdwxYw7#t$rt$r|j$j?ddwxYw#t$r/ |jfjen#t$rYnwxYwYwxYw#|jZj]||j$jSdwxYww)a Handle the lifecycle of a WebSocket connection. Since this method doesn't have a caller able to handle exceptions, it attempts to log relevant ones and guarantees that the TCP connection is closed before exiting. N)r5rKrLr8z! invalid originT)exc_infoz'Failed to open a WebSocket connection: z. z! invalid upgrade)Upgrade websocketz^. You cannot access a WebSocket server directly with a browser. You need a WebSocket client. z! invalid handshakez; zopening handshake failedsLFailed to open a WebSocket connection. See server log for more information. DateusegmtServerzContent-Lengthz Content-Typez text/plain Connectionclosezconnection rejected (%d %s)zconnection closedzconnection handler failedizclosing handshake failed)4rr< handshaker5rKrLr8asyncio TimeoutErrorConnectionError Exception isinstancer'statusheadersbodyrdebugr4http HTTPStatus FORBIDDENrencoderUPGRADE_REQUIREDrr BaseException __cause__ BAD_REQUESTerrorINTERNAL_SERVER_ERROR setdefaultemailutils formatdater9strlenwrite_http_responseinfovaluephraseclose_transportrJ unregisterrIclosedfail_connectionrfr[)rOexcrmrnro exc_chainexc_strs rSrYzWebSocketServerProtocol.handlersi 2I *4+<+<=.. $ -1-F-F/3/J/J&*&8&8 )T ood+++ jjl""& NN % %d + KK  0 1O'' " = c>2,/JJ SXXTGF]3zz ))*<@""<9(($?   16<<**,,,< NN % %d + KK  0 1y= @,  !!"=!M{{((.  #"   !!"C#C>AC)#C%$C)( C>3C'4C>9Q9 Q6Q9S&S'S+T3,7U.#C>%C)'C>)C;/C2 0C;7C>>&Q3$FQ.:E3Q.-P0.Q.3S877U..Q33S86Q99AR>>S8S1S55S88 T0TT0 T)&T0(T))T0,T3/T00T338U++U.cK t|jd{\}}|j rQ|jj d||jD]"\}}|jj d||$||_ ||_ ||fS7v#tj$rt$r}t d|d}~wwxYww)a: Read request line and headers from the HTTP request. If the request contains a body, it may be read from ``self.reader`` after this coroutine returns. Raises: InvalidMessage: If the HTTP message is malformed or isn't an HTTP/1.1 GET request. Nz$did not receive a valid HTTP requestz< GET %s HTTP/1.1z< %s: %s) r*readerrhCancelledErrorrkrrpr4 raw_itemspathrequest_headers)rOrrnrkeyrs rSread_http_requestz)WebSocketServerProtocol.read_http_request s R".t{{";;MD' :: KK  14 8%//1 : U !!*c59 : &W}<%%   R !GHc Q Rs8CBBBA/CBC1 B==CCc(||_|jr|jjd|j|j|j D]"\}}|jjd||$|%|jjdt |d|jd|jd}|t|z }|jj|j||jj|yy)z Write status line and headers to the HTTP response. This coroutine is also able to write a response body. z> HTTP/1.1 %d %sz> %s: %sNz> [body] (%d bytes)z HTTP/1.1  z ) response_headersrpr4rrrrrr[writert)rOrmrnrorrresponses rSrz+WebSocketServerProtocol.write_http_response's!( :: KK  0&,, N%//1 : U !!*c59 : !!"7TCv||nAfmm_DACL  X__./   NN  & r\cK|jH|j||}t|tr |d{Stjdt |Sy7!w)a Intercept the HTTP request and return an HTTP response if appropriate. You may override this method in a :class:`WebSocketServerProtocol` subclass, for example: * to return an HTTP 200 OK response on a given path; then a load balancer can use this path for a health check; * to authenticate the request and return an HTTP 401 Unauthorized or an HTTP 403 Forbidden when authentication fails. You may also override this method with the ``process_request`` argument of :func:`serve` and :class:`WebSocketServerProtocol`. This is equivalent, except ``process_request`` won't have access to the protocol instance, so it can't store information for later use. :meth:`process_request` is expected to complete quickly. If it may run for a long time, then it should await :meth:`wait_closed` and exit if :meth:`wait_closed` completes, or else it could prevent the server from shutting down. Args: path: Request path, including optional query string. request_headers: Request headers. Returns: tuple[StatusLike, HeadersLike, bytes] | None: :obj:`None` to continue the WebSocket handshake normally. An HTTP response, represented by a 3-uple of the response status, headers, and body, to abort the WebSocket handshake and return that HTTP response instead. N&declare process_request as a coroutine)rMrlrrErFrG)rOrrrs rSr:z'WebSocketServerProtocol.process_requestCs\J  ,,,T?CH(I.%~% <>P &s4AA"Ac |jd}|tt|}|||vr t ||S#t$r}tdd|d}~wwxYw)z Handle the Origin HTTP request header. Args: headers: Request headers. origins: Optional list of acceptable origins. Raises: InvalidOrigin: If the origin isn't acceptable. r#zmultiple valuesN)getrrr r#r)rnr5rQrs rSprocess_originz&WebSocketServerProtocol.process_origintsl" F[[*F  &&)F  W$#F++ # F*;<# E Fs8 A AAcd}g}g}|jd}|r|rt|Dcgc] }t|c}g}|D]W\}} |D]M} | j|k7r | j | |\} } |j || f|j | WY|r t|}||fScc}w#t $rYswxYw)a Handle the Sec-WebSocket-Extensions HTTP request header. Accept or reject each extension proposed in the client request. Negotiate parameters for accepted extensions. Return the Sec-WebSocket-Extensions HTTP response header and the list of accepted extensions. :rfc:`6455` leaves the rules up to the specification of each :extension. To provide this level of flexibility, for each extension proposed by the client, we check for a match with each extension available in the server configuration. If no match is found, the extension is ignored. If several variants of the same extension are proposed by the client, it may be accepted several times, which won't make sense in general. Extensions must implement their own requirements. For this purpose, the list of previously accepted extensions is provided. This process doesn't allow the server to reorder extensions. It can only select a subset of the extensions proposed by the client. Other requirements, for example related to mandatory extensions or the order of extensions, may be implemented by overriding this method. Args: headers: Request headers. extensions: Optional list of supported extensions. Raises: InvalidHandshake: To abort the handshake with an HTTP 400 error. NSec-WebSocket-Extensions)get_allsumrnameprocess_request_paramsrappendr) rnrKresponse_header_valueextension_headersaccepted_extensions header_values header_valueparsed_header_valuesrrequest_params ext_factoryresponse_params extensions rSprocess_extensionsz*WebSocketServerProtocol.process_extensionssP-135/1(BC 1:=CPQ<.QSU; )= $n#7K"''4/ !5@5W5W*,?62&,,dO-DE'..y9% 2 $34E$F !$&999?R,! !sB,B11 B=<B=cd}|jd}|r7|r5t|Dcgc] }t|c}g}|j||}|Scc}w)a Handle the Sec-WebSocket-Protocol HTTP request header. Return Sec-WebSocket-Protocol HTTP response header, which is the same as the selected subprotocol. Args: headers: Request headers. available_subprotocols: Optional list of supported subprotocols. Raises: InvalidHandshake: To abort the handshake with an HTTP 400 error. NSec-WebSocket-Protocol)rrrr;)rOrnrL subprotocolrrrs rSprocess_subprotocolz+WebSocketServerProtocol.process_subprotocolsf"+/ (@A 369ERS\"<0SUW7 11$&<KTsAc|j|jSttz}|syt|fddS)a Pick a subprotocol among those supported by the client and the server. If several subprotocols are available, select the preferred subprotocol by giving equal weight to the preferences of the client and the server. If no subprotocol is available, proceed without a subprotocol. You may provide a ``select_subprotocol`` argument to :func:`serve` or :class:`WebSocketServerProtocol` to override this logic. For example, you could reject the handshake if the client doesn't support a particular subprotocol, rather than accept the handshake without that subprotocol. Args: client_subprotocols: List of subprotocols offered by the client. server_subprotocols: List of subprotocols available on the server. Returns: Selected subprotocol, if a common subprotocol was found. :obj:`None` to continue without a subprotocol. NcJj|j|zSN)index)pclient_subprotocolsserver_subprotocolss rSz.(s%-33A69L9R9RST9UUr\)rr)rNsetsorted)rOrrr7s `` rSr;z*WebSocketServerProtocol.select_subprotocols_:  # # /++,?ATU U./#6I2JJ  U    r\c`K|jd{\}}|j||}t|tr |d{}nt j dt |}|jtjur td|jjstjjgdf}|t!|t#|} |j%|||_|j)||\} |_|j-||x} |_t1} t3| | | | | d<| | | d<t5|r|||j6}|| j9|| j;dt<j>jAd |jB| j;d |jB|jEtjjF| |jHjKd |jM|S77w) a Perform the server side of the opening handshake. Args: origins: List of acceptable values of the Origin HTTP header; include :obj:`None` if the lack of an origin is acceptable. extensions: List of supported extensions, in order in which they should be tried. subprotocols: List of supported subprotocols, in order of decreasing preference. extra_headers: Arbitrary HTTP headers to add to the response when the handshake succeeds. Returns: path of the URI of the request. Raises: InvalidHandshake: If the handshake fails. Nrz*connection closed during opening handshakesServer is shutting down. rrraTrbrdzconnection open)'rr:rlrrErFrGstater CLOSEDBrokenPipeErrorrJ is_servingrqrrSERVICE_UNAVAILABLEr'r)rrQrr6rrrr(callablerupdater{r|r}r~r9rSWITCHING_PROTOCOLSr4rconnection_open) rOr5rKrLr8rrearly_response_awaitableearly_responserextensions_headerprotocol_headerrs rSrgz!WebSocketServerProtocol.handshake+s6'+&<&<&> >o$(#7#7o#N . :#;;N MMBDV W5N :: %!"NO O~~((*33-N  % .1 1O,))/7C -1-D-D 1. *4?.2-E-E 3.  $*#9'-  (;L 7 8  &9H 5 6 M ")$0D0DEM  $  # #M 2##FEKK,B,B$,B,OP    )  ' '$2D2D E   !D!DFVW *+  C!? I D%)26>B596:$*  %'++) G +)#+)"+)0+)<+)3+)4+)"+) L!+)& Y'+)*#++),-+). /+)Z Br2h<OS'%'07'?K' '8//*1/ /bDH#A 6O:O:EO: ,O:O:d8T @& 2& 3&   & T37HL?C6: \/\F\!= \ 4 \ \r\r/ceZdZdZdddZddZddZddZdddZddZ dd Z dd Z dd Z dd Z dd ZeddZddZ ddZy)r0a WebSocket server returned by :func:`serve`. This class mirrors the API of :class:`~asyncio.Server`. It keeps track of WebSocket connections in order to close them properly when shutting down. Args: logger: Logger for this server. It defaults to ``logging.getLogger("websockets.server")``. See the :doc:`logging guide <../../topics/logging>` for details. Ncp|tjd}||_t|_d|_|y)Nr>)rArBr4r websockets close_task)rOr4s rSrDzWebSocketServer.__init__s8 >&&':;F 9<6: r\c ||_|jD]}|jtjk(rd|j z}n{|jtj k(rd|j ddz}nG|jtjk(r|j }nt|j }|jjd||jj|_ y)a Attach to a given :class:`~asyncio.Server`. Since :meth:`~asyncio.loop.create_server` doesn't support injecting a custom ``Server`` class, the easiest solution that doesn't rely on private :mod:`asyncio` APIs is to: - instantiate a :class:`WebSocketServer` - give the protocol factory a reference to that instance - call :meth:`~asyncio.loop.create_server` with the factory - attach the resulting :class:`~asyncio.Server` with this method z%s:%dz[%s]:%dNr zserver listening on %s)r2socketsfamilysocketAF_INET getsocknameAF_INET6AF_UNIXrr4rget_loop create_future closed_waiter)rOr2sockrs rSwrapzWebSocketServer.wraps NN =D{{fnn,!1!1!33/ 4#3#3#5bq#99.'')4++-. KK  5t < =$__.<<>r\c:|jj|y)z: Register a connection with this server. N)raddrOprotocols rSrVzWebSocketServer.registers H%r\c:|jj|y)z< Unregister a connection with this server. N)rremovers rSrzWebSocketServer.unregisters x(r\c|j4|jj|j||_yy)aw Close the server. * Close the underlying :class:`~asyncio.Server`. * When ``close_connections`` is :obj:`True`, which is the default, close existing connections. Specifically: * Reject opening WebSocket connections with an HTTP 503 (service unavailable) error. This happens when the server accepted the TCP connection but didn't complete the opening handshake before closing. * Close open WebSocket connections with close code 1001 (going away). * Wait until all connection handlers terminate. :meth:`close` is idempotent. N)rrrX_close)rOclose_connectionss rSrfzWebSocketServer.closes8$ ?? ""mmo99 -.DO #r\c K|jjd|jjt j dd{|rv|j Dcgc]B}|jtjur$t j|jdD}}|rt j|d{|jjd{|j r?t j|j Dcgc]}|jc}d{|jjd|jjdy7!cc}w77cc}w7Lw)a Implementation of :meth:`close`. This calls :meth:`~asyncio.Server.close` on the underlying :class:`~asyncio.Server` object to stop accepting new connections and then closes open connections with close code 1001. zserver closingrNiz server closed)r4rr2rfrhsleeprrr CONNECTINGrXwait wait_closedrZr set_result)rOrr` close_taskss rSrzWebSocketServer._closes; )*  mmA  "&??%*:*::##IOOD$9:K ll;///kk%%''' ??,,9=II''I   %%d+ )7  0 ( J saAFE1F%AE4,FE9 !F*E;+-FE=+ F5F6skk''))) (&(cTK|jjd{y7w)a See :meth:`asyncio.Server.serve_forever`. Typical use:: server = await serve(...) # this coroutine doesn't return # canceling it stops the server await server.serve_forever() This is an alternative to using :func:`serve` as an asynchronous context manager. Shutdown is triggered by canceling :meth:`serve_forever` instead of exiting a :func:`serve` context. N)r2 serve_foreverrs rSr zWebSocketServer.serve_foreverLs kk'')))r c.|jjS)z6 See :attr:`asyncio.Server.sockets`. )r2rrs rSrzWebSocketServer.sockets^s {{"""r\cK|Swrr@rs rS __aenter__zWebSocketServer.__aenter__fs  sc`K|j|jd{y7wr)rfrrOexc_type exc_value tracebacks rS __aexit__zWebSocketServer.__aexit__is#    s $.,.r)r4rrr)r2zasyncio.base_events.Serverrr)rr/rr)T)rboolrrr)rzasyncio.AbstractEventLoop)rr)rzIterable[socket.socket]rr0rztype[BaseException] | NonerzBaseException | NonerzTracebackType | Nonerr)rrrrrDrrVrrfrrrrr r propertyrrrr@r\rSr0r0s  1?@&).,*\1*&( **$##!,!(!( !  !r\r0ceZdZdZ ddddddddeddddddddddd  dd Zdd Z dd Zdd ZddZ eZ y)Servea Start a WebSocket server listening on ``host`` and ``port``. Whenever a client connects, the server creates a :class:`WebSocketServerProtocol`, performs the opening handshake, and delegates to the connection handler, ``ws_handler``. The handler receives the :class:`WebSocketServerProtocol` and uses it to send and receive messages. Once the handler completes, either normally or with an exception, the server performs the closing handshake and closes the connection. Awaiting :func:`serve` yields a :class:`WebSocketServer`. This object provides a :meth:`~WebSocketServer.close` method to shut down the server:: # set this future to exit the server stop = asyncio.get_running_loop().create_future() server = await serve(...) await stop server.close() await server.wait_closed() :func:`serve` can be used as an asynchronous context manager. Then, the server is shut down automatically when exiting the context:: # set this future to exit the server stop = asyncio.get_running_loop().create_future() async with serve(...): await stop Args: ws_handler: Connection handler. It receives the WebSocket connection, which is a :class:`WebSocketServerProtocol`, in argument. host: Network interfaces the server binds to. See :meth:`~asyncio.loop.create_server` for details. port: TCP port the server listens on. See :meth:`~asyncio.loop.create_server` for details. create_protocol: Factory for the :class:`asyncio.Protocol` managing the connection. It defaults to :class:`WebSocketServerProtocol`. Set it to a wrapper or a subclass to customize connection handling. logger: Logger for this server. It defaults to ``logging.getLogger("websockets.server")``. See the :doc:`logging guide <../../topics/logging>` for details. compression: The "permessage-deflate" extension is enabled by default. Set ``compression`` to :obj:`None` to disable it. See the :doc:`compression guide <../../topics/compression>` for details. origins: Acceptable values of the ``Origin`` header, for defending against Cross-Site WebSocket Hijacking attacks. Include :obj:`None` in the list if the lack of an origin is acceptable. extensions: List of supported extensions, in order in which they should be negotiated and run. subprotocols: List of supported subprotocols, in order of decreasing preference. extra_headers (HeadersLike | Callable[[str, Headers] | HeadersLike]): Arbitrary HTTP headers to add to the response. This can be a :data:`~websockets.datastructures.HeadersLike` or a callable taking the request path and headers in arguments and returning a :data:`~websockets.datastructures.HeadersLike`. server_header: Value of the ``Server`` response header. It defaults to ``"Python/x.y.z websockets/X.Y"``. Setting it to :obj:`None` removes the header. process_request (Callable[[str, Headers], Awaitable[tuple[StatusLike, HeadersLike, bytes] | None]] | None): Intercept HTTP request before the opening handshake. See :meth:`~WebSocketServerProtocol.process_request` for details. select_subprotocol: Select a subprotocol supported by the client. See :meth:`~WebSocketServerProtocol.select_subprotocol` for details. open_timeout: Timeout for opening connections in seconds. :obj:`None` disables the timeout. See :class:`~websockets.legacy.protocol.WebSocketCommonProtocol` for the documentation of ``ping_interval``, ``ping_timeout``, ``close_timeout``, ``max_size``, ``max_queue``, ``read_limit``, and ``write_limit``. Any other keyword arguments are passed the event loop's :meth:`~asyncio.loop.create_server` method. For example: * You can set ``ssl`` to a :class:`~ssl.SSLContext` to enable TLS. * You can set ``sock`` to a :obj:`~socket.socket` that you created outside of websockets. Returns: WebSocket server. Ndeflater3i i)create_protocolr4 compressionr5r6r7r8r9r:r;r< ping_interval ping_timeout close_timeoutmax_size max_queue read_limit write_limitc |jdd}|d}ntjdt||}|jdd}|t}ntjdt||}|jdd}|jdd}|t j }n|}tjd tt| }|jd du}|d k(r t|}n|td || t| ttdtf|}tj|t!||fid|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d| d| d| d| d | d!|}|jd"dr;|jd#d}||Jtj|j"||fi|} n#tj|j$|||fi|} | |_||_y)$Ntimeoutr3zrename timeout to close_timeoutklasszrename klass to create_protocol legacy_recvFrWzremove loop argument)r4sslrzunsupported compression: .hostportsecurer<r"r#r$r%r&r'r(r5r6r7r8r9r:r;r4unixr)poprErFrGr/rhget_event_loopr0rr ValueErrorrr r functoolspartialrHcreate_unix_server create_server_create_serverrJ)!rOrIr.r/r r4r!r5r6r7r8r9r:r;r<r"r#r$r%r&r'r(rPr*r+r,_looprWrJr0factoryrr8s! rSrDzServe.__init__sF!' 9d ; ?G MM;=O P  #M7=jj$6O =+E MM;=O P  "#O#JJ}e< 39**VT2J =))+DD MM02D E#62 E"$. ) #9*EJ  $8 FG G  # !, /x-D(DEW##  ! ,      & ( & (    "! "$# $% &$' () *"+ ,&- .(/ 0(1 2,3 4 25 67 < ::fe $%zz&$7D
|jjSr)__await_impl__ __await__rs rSr@zServe.__await__^s""$..00r\cK|jd{}|jj||jS7+wr)r9rJr)rOr2s rSr?zServe.__await_impl__bs8**,, F#~~-sAA,A)NN).rIrr.zstr | Sequence[str] | Noner/ int | Noner z-Callable[..., WebSocketServerProtocol] | Noner4rr!rr5rr6rr7rr8rr9rr:rr;rr<rr"rr#rr$rr%rBr&rBr'intr(rCrPr rrrr)rz%Generator[Any, None, WebSocketServer]) rrrrrrDrrr@r?__iter__r@r\rSrrssZF,0|#JN$("+26>B596:$*  %'&(%'&*$ $ ?|# G |#)|#|#G|#"|# |#0|#<|#3|# 4!|#""#|#& L'|#, Y-|#0#1|#2$3|#4#5|#6$7|#89|#:;|#<=|#>?|#@A|#B C|#@+,+(+( +  +1Hr\rc  t|f|dd|S)a Start a WebSocket server listening on a Unix socket. This function is identical to :func:`serve`, except the ``host`` and ``port`` arguments are replaced by ``path``. It is only available on Unix. Unrecognized keyword arguments are passed the event loop's :meth:`~asyncio.loop.create_unix_server` method. It's useful for deploying a server behind a reverse proxy such as nginx. Args: path: File system path to the Unix socket. T)rr1)r-)rIrrPs rSr.r.os0  <$T ._ws_handlersLT5s;Ys^KLY^^----s?A AA )r`r/rr ) inspect signaturebind TypeErrorrErFrGr r r/rr )rIrHs` rSrHrHs *%**40& )*IcN:; %     j ) . .tR 8 MM@BT U -       s5$A B1%B;"B1 B+(B1*B++B10B1r)rIrrrrPr rr)rIrrz3Callable[[WebSocketServerProtocol], Awaitable[Any]])J __future__rrh email.utilsr|r5rqrIrArrEcollections.abcrrrrtypesrtypingr r r r asyncio.compatibilityrdatastructuresrrr exceptionsrrrrrrr6rrextensions.permessage_deflaterrnrrrrhttp11rrr r!r"r#r$r%r'rgr(r)r*r+r,__all__rHeadersLikeOrCallabletuplebytes HTTPResponser/r0rr-r.rHr@r\rSr\s$"  DD--3FF;L QQ&48 k8S'NK4O+PPQZe34 N 5N bf!f!Rvvr  = C=  == =6 C 9 r\