Ë
    ·�©jg`  ã            	      óœ  — d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
mZ d dlmZmZmZ ddlmZmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZ ddl m!Z!m"Z" dd	l#m$Z$m%Z%m&Z&m'Z'm(Z( dd
l)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/m0Z0m1Z1m2Z2m3Z3 ddlm4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;m<Z< dgZ= G d„ de2«      Z> G d„ de>«      Z? e- e@«       ddddddœ¬«       y)é    )ÚannotationsN)Ú	GeneratorÚSequence)ÚAnyÚCallableÚcasté   )ÚHeadersÚMultipleValuesError)ÚHeaderLineTooLongÚInvalidHandshakeÚInvalidHeaderÚInvalidHeaderValueÚInvalidMessageÚInvalidMethodÚInvalidOriginÚInvalidProtocolÚInvalidUpgradeÚNegotiationErrorÚRequestLineTooLongÚTooManyHeaders)Ú	ExtensionÚServerExtensionFactory)Úbuild_extensionÚparse_connectionÚparse_extensionÚparse_subprotocolÚparse_upgrade)ÚRequestÚResponse)Úlazy_import)Ú
CONNECTINGÚOPENÚSERVERÚProtocolÚState)ÚConnectionOptionÚExtensionHeaderÚ
LoggerLikeÚOriginÚ
StatusLikeÚSubprotocolÚUpgradeProtocol)Ú
accept_keyÚServerProtocolc                  ó¸   ‡ — e Zd ZdZddddedddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Z	 	 	 	 dd„Zdd„Z	 	 	 	 dd	„Z	dd
„Z
	 	 	 	 dd„Zdd„Zdd„Zdˆ fd„Zˆ xZS )r/   aî  
    Sans-I/O implementation of a WebSocket server connection.

    Args:
        origins: Acceptable values of the ``Origin`` header. Values can be
            :class:`str` to test for an exact match or regular expressions
            compiled by :func:`re.compile` to test against a pattern. Include
            :obj:`None` in the list if the lack of an origin is acceptable.
            This is useful for defending against Cross-Site WebSocket
            Hijacking attacks.
        extensions: List of supported extensions, in order in which they
            should be tried.
        subprotocols: List of supported subprotocols, in order of decreasing
            preference.
        select_subprotocol: Callback for selecting a subprotocol among
            those supported by the client and the server. It has the same
            signature as the :meth:`select_subprotocol` method, including a
            :class:`ServerProtocol` instance as first argument.
        state: Initial state of the WebSocket connection.
        max_size: Maximum size of incoming messages in bytes.
            :obj:`None` disables the limit. You may pass a ``(max_message_size,
            max_fragment_size)`` tuple to set different limits for messages and
            fragments when you expect long messages sent in short fragments.
        logger: Logger for this connection;
            defaults to ``logging.getLogger("websockets.server")``;
            see the :doc:`logging guide <../../topics/logging>` for details.

    Ni   )ÚoriginsÚ
extensionsÚsubprotocolsÚselect_subprotocolÚstateÚmax_sizeÚloggerc               ó¾   •— t         ‰| �  t        |||¬«       || _        || _        || _        |�'t        | d|j                  | | j                  «      «       d| _	        y )N)Úsider5   r6   r7   r4   F)
ÚsuperÚ__init__r$   r1   Úavailable_extensionsÚavailable_subprotocolsÚsetattrÚ__get__Ú	__class__Úaccept_called)	Úselfr1   r2   r3   r4   r5   r6   r7   r@   s	           €úX/var/www/html/streamforge-license/venv/lib/python3.12/site-packages/websockets/server.pyr;   zServerProtocol.__init__S   sp   ø€ ô" 	‰ÑÜØØØð	 	ô 	
ð ˆŒØ$.ˆÔ!Ø&2ˆÔ#ØÐ)ô ØØ$Ø"×*Ñ*¨4°·±Ó@ôð #ˆÕó    c                ó   — d| _         	 | j                  |«      \  }}}t5        «       }	t6        j8                  j;                  d¬«      |	d<   d|	d<   d|	d<   ||	d<   |�||	d<   |�||	d<   t=        dd|	«      S # t        $ ro}||_        || _        | j
                  r| j                  j                  dd¬«       | j                  t        j                  j                  d|› d�«      cY d}~S d}~wt        $ r€}||_        || _        | j
                  r| j                  j                  dd¬«       | j                  t        j                  j                  d|› d�«      }d|j                  d	<   |cY d}~S d}~wt        $ ro}||_        || _        | j
                  r| j                  j                  d
d¬«       | j                  t        j                  j                  d|› d�«      cY d}~S d}~wt         $ r€}||_        || _        | j
                  r| j                  j                  dd¬«       | j                  t        j                  j"                  d|› d�«      }d|j                  d<   |cY d}~S d}~wt$        $ r¯}||_        || _        | j
                  r| j                  j                  dd¬«       t'        t(        |«      }|› }|j*                  �!|j*                  }|d|› �z  }|j*                  �Œ!| j                  t        j                  j,                  d|› d�«      cY d}~S d}~wt.        $ r_}||_        || _        | j                  j1                  dd¬«       | j                  t        j                  j2                  d«      cY d}~S d}~ww xY w)aÅ  
        Create a handshake response to accept the connection.

        If the handshake request is valid and the handshake successful,
        :meth:`accept` returns an HTTP response with status code 101.

        Else, it returns an HTTP response with another status code. This rejects
        the connection, like :meth:`reject` would.

        You must send the handshake response with :meth:`send_response`.

        You may modify the response before sending it, typically by adding HTTP
        headers.

        Args:
            request: WebSocket handshake request received from the client.

        Returns:
            WebSocket handshake response or HTTP response to send to the client.

        Tz! invalid origin©Úexc_infoú'Failed to open a WebSocket connection: ú.
Nz! invalid methodÚGETÚAllowz! invalid protocolz! invalid upgradez^.

You cannot access a WebSocket server directly with a browser. You need a WebSocket client.
Ú	websocketÚUpgradez! invalid handshakez; zopening handshake failedzLFailed to open a WebSocket connection.
See server log for more information.
©ÚusegmtÚDateÚ
ConnectionzSec-WebSocket-AcceptúSec-WebSocket-ExtensionsúSec-WebSocket-Protocolée   zSwitching Protocols)rA   Úprocess_requestr   Ú
_exceptionÚhandshake_excÚdebugr7   ÚrejectÚhttpÚ
HTTPStatusÚ	FORBIDDENr   ÚMETHOD_NOT_ALLOWEDÚheadersr   ÚHTTP_VERSION_NOT_SUPPORTEDr   ÚUPGRADE_REQUIREDr   r   ÚBaseExceptionÚ	__cause__ÚBAD_REQUESTÚ	ExceptionÚerrorÚINTERNAL_SERVER_ERRORr
   ÚemailÚutilsÚ
formatdater    )
rB   ÚrequestÚaccept_headerÚextensions_headerÚprotocol_headerÚexcÚresponseÚ	exc_chainÚexc_strr^   s
             rC   ÚacceptzServerProtocol.accepty   sq  € ð, "ˆÔðM	ð
 ×$Ñ$ WÓ-ñ	ØØ!ØôV “)ˆÜŸ+™+×0Ñ0¸Ð0Ó=ˆ�‰Ø(ˆ�	ÑØ )ˆ�ÑØ*7ˆÐ&Ñ'ØÐ(Ø2CˆGÐ.Ñ/ØÐ&Ø0?ˆGÐ,Ñ-Ü˜Ð2°GÓ<Ð<øôe ò 	Ø!$ˆGÔØ!$ˆDÔØ�zŠzØ—‘×!Ñ!Ð"4¸tÐ!ÔDØ—;‘;Ü—‘×)Ñ)Ø9¸#¸¸cÐBóõ ûô ò 
	Ø!$ˆGÔØ!$ˆDÔØ�zŠzØ—‘×!Ñ!Ð"4¸tÐ!ÔDØ—{‘{Ü—‘×2Ñ2Ø9¸#¸¸cÐBóˆHð ).ˆH×Ñ˜WÑ%Ø�OûÜò 	Ø!$ˆGÔØ!$ˆDÔØ�zŠzØ—‘×!Ñ!Ð"6ÀÐ!ÔFØ—;‘;Ü—‘×:Ñ:Ø9¸#¸¸cÐBóõ ûô ò 	Ø!$ˆGÔØ!$ˆDÔØ�zŠzØ—‘×!Ñ!Ð"5ÀÐ!ÔEØ—{‘{Ü—‘×0Ñ0à=¸c¸Uð CEð FóˆHð +6ˆH×Ñ˜YÑ'Ø�OûÜò 	Ø!$ˆGÔØ!$ˆDÔØ�zŠzØ—‘×!Ñ!Ð"7À$Ð!ÔGÜœ]¨CÓ0ˆIØ"˜ˆGØ×%Ñ%Ð1Ø%×/Ñ/�	Ø˜R 	˜{Ð+Ñ+�ð ×%Ñ%Ñ1ð —;‘;Ü—‘×+Ñ+Ø9¸'¸À#ÐFóõ ûô ò 	ð "%ˆGÔØ!$ˆDÔØ�K‰K×ÑÐ8À4ÐÔHØ—;‘;Ü—‘×5Ñ5ð=óõ ûð	úsƒ   ‰A5 Á5	NÁ>A$C(Ã"NÃ(NÃ4A5E/Å)NÅ/NÅ;A$G%ÇNÇ%NÇ1A5I,É&NÉ,NÉ8A6L"Ë/-L"ÌNÌ"NÌ.ANÎNÎNc                óî  — |j                   dk7  rt        |j                   «      ‚|j                  dk7  rt        |j                  «      ‚|j                  }t        |j                  d«      D �cg c]  }t        |«      ‘Œ c}g «      }t        d„ |D «       «      s#t        d|rdj                  |«      «      ‚d«      ‚t        |j                  d«      D �cg c]  }t        |«      ‘Œ c}g «      }t        |«      dk(  r|d	   j                  «       d
k(  s#t        d|rdj                  |«      «      ‚d«      ‚	 |d   }	 t#        j$                  |j'                  «       d¬«      }t        |«      dk7  rt-        d|«      ‚t/        |«      }		 |d   }
|
dk7  rt-        d|
«      ‚| j1                  |«      | _        | j5                  |«      \  }| _        | j9                  |«      x}| _        |	||fS c c}w c c}w # t        $ r t        d«      d‚t         $ r t        dd«      d‚w xY w# t(        j*                  $ r}t-        d|«      |‚d}~ww xY w# t        $ r t        d«      d‚t         $ r t        dd«      d‚w xY w)aÊ  
        Check a handshake request and negotiate extensions and subprotocol.

        This function doesn't check the ``Host`` header. This control must be
        performed by the HTTP stack earlier. It's the responsibility of the
        caller.

        Args:
            request: WebSocket handshake request received from the client.

        Returns:
            ``Sec-WebSocket-Accept``, ``Sec-WebSocket-Extensions``, and
            ``Sec-WebSocket-Protocol`` headers for the handshake response.

        Raises:
            InvalidMethod: If the request method isn't GET; then the
                server must return a 405 Method Not Allowed error.
            InvalidProtocol: If the request protocol isn't HTTP/1.1; then
                the server must return a 505 HTTP Version Not Supported
                error.
            InvalidHandshake: If the handshake request is invalid;
                then the server must return a 400 Bad Request error.

        rJ   zHTTP/1.1rQ   c              3  óB   K  — | ]  }|j                  «       d k(  –— Œ y­w)ÚupgradeN)Úlower)Ú.0Úvalues     rC   ú	<genexpr>z1ServerProtocol.process_request.<locals>.<genexpr>  s   è ø€ ÒF°%�5—;‘;“= IÕ-ÑFùs   ‚ú, NrM   r	   r   rL   zSec-WebSocket-Keyúmultiple valuesT)Úvalidateé   zSec-WebSocket-VersionÚ13)Úmethodr   Úprotocolr   r^   ÚsumÚget_allr   Úanyr   Újoinr   Úlenrv   ÚKeyErrorr   r   Úbase64Ú	b64decodeÚencodeÚbinasciiÚErrorr   r.   Úprocess_originÚoriginÚprocess_extensionsr2   Úprocess_subprotocolÚsubprotocol)rB   rj   r^   rx   Ú
connectionru   ÚkeyÚraw_keyrn   rk   Úversionrl   rm   s                rC   rU   zServerProtocol.process_requestê   sŒ  € ð8 �>‰>˜UÒ"Ü §¡Ó/Ð/à×Ñ˜zÒ)Ü! '×"2Ñ"2Ó3Ð3à—/‘/ˆä-0Ø29·/±/À,Ó2OÖP¨Ô˜eÕ$ÒPÐRTó.
ˆ
ô ÑF¸:ÔFÔFÜ Ø±z˜dŸi™i¨
Ó3óð ØGKóð ô *-Ø/6¯©¸yÓ/IÖJ eŒ]˜5Õ!ÒJÈBó*
ˆô �G“ Ò! g¨a¡j×&6Ñ&6Ó&8¸KÒ&GÜ  Á'¨D¯I©I°gÓ,>ÓTÐTÈtÓTÐTð	RØÐ-Ñ.ˆCð
	HÜ×&Ñ& s§z¡z£|¸dÔCˆGô ˆw‹<˜2ÒÜ$Ð%8¸#Ó>Ð>Ü" 3›ˆð	VØÐ5Ñ6ˆGð
 �dŠ?Ü$Ð%<¸gÓFÐFà×)Ñ)¨'Ó2ˆŒØ-1×-DÑ-DÀWÓ-MÑ*Ð˜4œ?Ø-1×-EÑ-EÀgÓ-NÐNˆ˜$Ô*àÐ0°/ÐBÐBùòW Qùò Køô ò 	?ÜÐ 3Ó4¸$Ð>Ü"ò 	RÜÐ 3Ð5FÓGÈTÐQð	Rûô �~‰~ò 	HÜ$Ð%8¸#Ó>ÀCÐGûð	Hûô ò 	CÜÐ 7Ó8¸dÐBÜ"ò 	VÜÐ 7Ð9JÓKÐQUÐUð	Vús<   Á-G)ÃG.Ä6G3 Ä<%H! ÆI	 Ç3+HÈ!IÈ4IÉIÉ	+I4c                ó@  — 	 |j                  d«      }|�t        t        |«      }| j
                  �S| j
                  D ]9  }||k(  s0t        |t        j                  «      sŒ#|€Œ&|j                  |«      €Œ8 |S  t        |«      ‚|S # t        $ r t        dd«      d‚w xY w)aG  
        Handle the Origin HTTP request header.

        Args:
            headers: WebSocket handshake request headers.

        Returns:
           origin, if it is acceptable.

        Raises:
            InvalidHandshake: If the Origin header is invalid.
            InvalidOrigin: If the origin isn't acceptable.

        r*   r{   N)Úgetr   r   r   r*   r1   Ú
isinstanceÚreÚPatternÚ	fullmatchr   )rB   r^   r�   Úorigin_or_regexs       rC   rŒ   zServerProtocol.process_origin<  s³   € ð"	GØ—[‘[ Ó*ˆFð ÐÜœ& &Ó)ˆFØ�<‰<Ð#Ø#'§<¡<ò ,�Ø" fÒ,Ü˜´·
±
Õ;ØÑ*Ø'×1Ñ1°&Ó9ÑEàð ˆð,ô $ FÓ+Ð+Øˆøô #ò 	GÜ Ð*;Ó<À$ÐFð	Gús   ‚B ÂBc                ó¨  — d}g }g }|j                  d«      }|r•| j                  r‰t        |D �cg c]  }t        |«      ‘Œ c}g «      }|D ]a  \  }}	| j                  D ]M  }
|
j                  |k7  rŒ	 |
j                  |	|«      \  }}|j                  ||f«       |j                  |«        Œa Œc |rt        |«      }||fS c c}w # t        $ r Y Œsw xY w)a›  
        Handle the Sec-WebSocket-Extensions HTTP request header.

        Accept or reject each extension proposed in the client request.
        Negotiate parameters for accepted extensions.

        Per :rfc:`6455`, negotiation rules are defined by 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: WebSocket handshake request headers.

        Returns:
            ``Sec-WebSocket-Extensions`` HTTP response header and list of
            accepted extensions.

        Raises:
            InvalidHandshake: If the Sec-WebSocket-Extensions header is invalid.

        NrR   )	r‚   r<   r�   r   ÚnameÚprocess_request_paramsr   Úappendr   )rB   r^   Úresponse_header_valueÚextension_headersÚaccepted_extensionsÚheader_valuesÚheader_valueÚparsed_header_valuesr�   Úrequest_paramsÚext_factoryÚresponse_paramsÚ	extensions                rC   rŽ   z!ServerProtocol.process_extensions_  s  € ðN -1Ðà35ÐØ/1ÐàŸ™Ð(BÓCˆá˜T×6Ò6Ü:=ØCPÖQ°<” Õ.ÒQÐSUó;Ð ð )=ò Ñ$��nØ#'×#<Ñ#<ò �Kà"×'Ñ'¨4Ò/Ø ð!Ø5@×5WÑ5WØ*Ð,?ó6Ñ2˜¨ð &×,Ñ,¨d°OÐ-DÔEØ'×.Ñ.¨yÔ9ñ ñ%ðñ2 Ü$3Ð4EÓ$FÐ!à$Ð&9Ð9Ð9ùò? Røô ,ò !Ù ð!ús   ¯C Á1CÃ	CÃCc                ó’   — t        |j                  d«      D �cg c]  }t        |«      ‘Œ c}g «      }| j                  |«      S c c}w )a‰  
        Handle the Sec-WebSocket-Protocol HTTP request header.

        Args:
            headers: WebSocket handshake request headers.

        Returns:
           Subprotocol, if one was selected; this is also the value of the
           ``Sec-WebSocket-Protocol`` response header.

        Raises:
            InvalidHandshake: If the Sec-WebSocket-Subprotocol header is invalid.

        rS   )r�   r‚   r   r4   )rB   r^   r¤   r3   s       rC   r�   z"ServerProtocol.process_subprotocol°  sR   € ô /2ð %,§O¡OÐ4LÓ$Möà ô " ,Õ/òð ó/
ˆð ×&Ñ& |Ó4Ð4ùòs   ™Ac                óÌ   — | j                   sy|st        d«      ‚t        |«      }| j                   D ]
  }||v sŒ|c S  t        ddj                  | j                   «      z   «      ‚)aq  
        Pick a subprotocol among those offered by the client.

        If several subprotocols are supported by both the client and the server,
        pick the first one in the list declared the server.

        If the server doesn't support any subprotocols, continue without a
        subprotocol, regardless of what the client offers.

        If the server supports at least one subprotocol and the client doesn't
        offer any, abort the handshake with an HTTP 400 error.

        You provide a ``select_subprotocol`` argument to :class:`ServerProtocol`
        to override this logic. For example, you could accept the connection
        even if client doesn't offer a subprotocol, rather than reject it.

        Here's how to negotiate the ``chat`` subprotocol if the client supports
        it and continue without a subprotocol otherwise::

            def select_subprotocol(protocol, subprotocols):
                if "chat" in subprotocols:
                    return "chat"

        Args:
            subprotocols: List of subprotocols offered by the client.

        Returns:
            Selected subprotocol, if a common subprotocol was found.

            :obj:`None` to continue without a subprotocol.

        Raises:
            NegotiationError: Custom implementations may raise this exception
                to abort the handshake with an HTTP 400 error.

        Nzmissing subprotocolz%invalid subprotocol; expected one of rz   )r=   r   Úsetr„   )rB   r3   Úproposed_subprotocolsr�   s       rC   r4   z!ServerProtocol.select_subprotocolÈ  s|   € ðR ×*Ò*Øñ Ü"Ð#8Ó9Ð9ô !$ LÓ 1ÐØ×6Ñ6ò 	#ˆKØÐ3Ò3Ø"Ò"ð	#ô
 Ø3Ø�i‰i˜×3Ñ3Ó4ñ5ó
ð 	
rD   c           
     ó  — t        j                  |«      }|j                  «       }t        dt        j
                  j                  d¬«      fddt        t        |«      «      fdg«      }t        |j                  |j                  ||«      S )a'  
        Create a handshake response to reject the connection.

        A short plain text response is the best fallback when failing to
        establish a WebSocket connection.

        You must send the handshake response with :meth:`send_response`.

        You may modify the response before sending it, for example by changing
        HTTP headers.

        Args:
            status: HTTP status code.
            text: HTTP response body; it will be encoded to UTF-8.

        Returns:
            HTTP response to send to the client.

        rP   TrN   )rQ   ÚclosezContent-Length)zContent-Typeztext/plain; charset=utf-8)rZ   r[   r‰   r
   rg   rh   ri   Ústrr…   r    rx   Úphrase)rB   ÚstatusÚtextÚbodyr^   s        rC   rY   zServerProtocol.reject  sw   € ô* —‘ Ó(ˆØ�{‰{‹}ˆÜàœŸ™×/Ñ/°tÐ/Ó<Ð=Ø'Ø!¤3¤s¨4£y£>Ð2Ø=ð	ó
ˆô ˜Ÿ™ f§m¡m°W¸dÓCÐCrD   c                óX  — | j                   r¯|j                  |j                  }}| j                  j                  d||«       |j                  j                  «       D ]"  \  }}| j                  j                  d||«       Œ$ |j                  r/| j                  j                  dt        |j                  «      «       | j                  j                  |j                  «       «       |j                  dk(  r;| j                  t        u sJ ‚t        | _        | j                  j                  d«       y| j                  rd}nd}| j                  j                  ||j                  |j                  «       | j!                  «        | j#                  «       | _        t'        | j$                  «       y)	zŒ
        Send a handshake response to the client.

        Args:
            response: WebSocket handshake response event to send.

        z> HTTP/1.1 %d %sz> %s: %sz> [body] (%d bytes)rT   zconnection openzconnection rejected (%d %s)zHTTP response sent (%d %s)N)rX   Ústatus_codeÚreason_phraser7   r^   Ú	raw_itemsr´   r…   ÚwritesrŸ   Ú	serializer5   r"   r#   ÚinforA   Úsend_eofÚdiscardÚparserÚnext)rB   ro   Úcoder±   r’   rx   Úlog_messages          rC   Úsend_responsezServerProtocol.send_response%  sI  € ð �:Š:Ø#×/Ñ/°×1GÑ1G�&ˆDØ�K‰K×ÑÐ0°$¸Ô?Ø&×.Ñ.×8Ñ8Ó:ò :‘
��UØ—‘×!Ñ! *¨c°5Õ9ð:à�}Š}Ø—‘×!Ñ!Ð"7¼¸X¿]¹]Ó9KÔLà�‰×Ñ˜8×-Ñ-Ó/Ô0à×Ñ 3Ò&Ø—:‘:¤Ñ+Ð+Ð+ÜˆDŒJØ�K‰K×ÑÐ.Õ/ð ×!Ò!Ø;‘à:�Ø�K‰K×ÑØØ×$Ñ$Ø×&Ñ&ôð �M‰MŒOØŸ,™,›.ˆDŒKÜ�—‘ÕrD   c              #  ón  •K  — | j                   t        u rÔ	 t        j                  | j                  j
                  «      E d {  –—† }| j                  r{| j                  j                  d	j2                  |j4                  |j6                  «       |j8                  j;                  «       D ]"  \  }}| j                  j                  d
||«       Œ$ | j<                  j?                  «       t@        ‰| �  «       E d {  –—†  y 7 Œ½# t        $ r~}|| _        | j                  r| j                  j                  dd¬«       | j                  t        j                  j                  d|› d�«      }| j                  |«       d –— Y d }~�Œ=d }~wt        t         f$ r~}|| _        | j                  r| j                  j                  dd¬«       | j                  t        j                  j"                  d|› d�«      }| j                  |«       d –— Y d }~�ŒÈd }~wt$        $ r“}t'        d«      | _        | j                  r| j                  j                  dd¬«       || j                  _        | j+                  «        | j-                  «       | _        t1        | j.                  «       d –— Y d }~�Œbd }~ww xY w7 �Œ·­w)Nz! request line too longTrF   rH   rI   z! header fields too largez$did not receive a valid HTTP requestz! no valid HTTP requestz
< %s %s %sz< %s: %s)!r5   r"   r   ÚparseÚreaderÚ	read_liner   rW   rX   r7   rY   rZ   r[   ÚREQUEST_URI_TOO_LONGrÂ   r   r   ÚREQUEST_HEADER_FIELDS_TOO_LARGErd   r   rb   r¼   r½   r¾   r¿   r   Úpathr€   r^   r¸   ÚeventsrŸ   r:   )rB   rj   rn   ro   r’   rx   r@   s         €rC   rÄ   zServerProtocol.parseK  s&  øè ø€ Ø�:‰:œÑ#ð#Ü%,§]¡]Ø—K‘K×)Ñ)ó&÷ �ðH �zŠzØ—‘×!Ñ!Ø  '§.¡.°'·,±,À×@PÑ@Pôð #*§/¡/×";Ñ";Ó"=ò >‘J�C˜Ø—K‘K×%Ñ% j°#°uÕ=ð>ð �K‰K×Ñ˜wÔ'ä‘7‘=“?×"Ñ"ð[ùô &ò 
Ø%(�Ô"Ø—:’:Ø—K‘K×%Ñ%Ð&?È$Ð%ÔOØŸ;™;ä—O‘O×8Ñ8Ø=¸c¸UÀ#ÐFó�ð
 ×"Ñ" 8Ô,ß‘ûÜ%¤~Ð6ò 	Ø%(�Ô"Ø—:’:Ø—K‘K×%Ñ%Ð&AÈDÐ%ÔQØŸ;™;Ü—O‘O×CÑCØ=¸c¸UÀ#ÐFó�ð ×"Ñ" 8Ô,ß‘ûÜò 
Ü%3Ø:ó&�Ô"ð —:’:Ø—K‘K×%Ñ%Ð&?È$Ð%ÔOØ/2�×"Ñ"Ô,Ø—‘”Ø"Ÿl™l›n�”Ü�T—[‘[Ô!ß‘ûð
úð* 	#ûst   ƒJ5—,D ÁDÁD ÁB3J5Ã;J2Ã<J5ÄD Ä	J/ÄA3FÅ?J5ÆJ/ÆA3HÈ
J5ÈJ/ÈBJ*Ê$J5Ê*J/Ê/J5)r1   z0Sequence[Origin | re.Pattern[str] | None] | Noner2   z'Sequence[ServerExtensionFactory] | Noner3   zSequence[Subprotocol] | Noner4   zLCallable[[ServerProtocol, Sequence[Subprotocol]], Subprotocol | None] | Noner5   r&   r6   z*int | None | tuple[int | None, int | None]r7   zLoggerLike | NoneÚreturnÚNone)rj   r   rË   r    )rj   r   rË   z"tuple[str, str | None, str | None])r^   r
   rË   zOrigin | None)r^   r
   rË   z"tuple[str | None, list[Extension]])r^   r
   rË   úSubprotocol | None)r3   zSequence[Subprotocol]rË   rÍ   )r²   r+   r³   r°   rË   r    )ro   r    rË   rÌ   )rË   zGenerator[None])Ú__name__Ú
__module__Ú__qualname__Ú__doc__r"   r;   rr   rU   rŒ   rŽ   r�   r4   rY   rÂ   rÄ   Ú__classcell__©r@   s   @rC   r/   r/   5   sõ   ø„ ñð@ EIØ>BØ59ð Ø!Ø?DØ$(ñ$#ð Bð$#ð <ð	$#ð
 3ð$#ðð$#ð ð$#ð =ð$#ð "ð$#ð  
õ!$#óLo=ðbPCàðPCð 
,óPCód!ðFO:àðO:ð 
,óO:ób5ð0:
à+ð:
ð 
ó:
óxDóB$÷L0#ñ 0#rD   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚServerConnectionc                óX   •— t        j                  dt        «       t        ‰| �  |i |¤Ž y )Nz.ServerConnection was renamed to ServerProtocol)ÚwarningsÚwarnÚDeprecationWarningr:   r;   )rB   ÚargsÚkwargsr@   s      €rC   r;   zServerConnection.__init__  s)   ø€ Ü�‰Ø<Üô	
ô 	‰Ñ˜$Ð) &Ó)rD   )rÚ   r   rÛ   r   rË   rÌ   )rÎ   rÏ   rÐ   r;   rÒ   rÓ   s   @rC   rÕ   rÕ   ~  s   ø„ ÷*ñ *rD   rÕ   z.legacy.server)ÚWebSocketServerÚWebSocketServerProtocolÚ	broadcastÚserveÚ
unix_serve)Údeprecated_aliases)AÚ
__future__r   r‡   rŠ   Úemail.utilsrg   rZ   r˜   r×   Úcollections.abcr   r   Útypingr   r   r   Údatastructuresr
   r   Ú
exceptionsr   r   r   r   r   r   r   r   r   r   r   r   r2   r   r   r^   r   r   r   r   r   Úhttp11r   r    Úimportsr!   r€   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   rh   r.   Ú__all__r/   rÕ   Úglobals© rD   rC   ú<module>rí      sµ   ðÝ "ã Û Û Û Û 	Û ß /ß &Ñ &ç 8÷÷ ÷ ó ÷ :÷õ ÷ &Ý  ß ?Õ ?÷÷ ñ õ ð Ð
€ôF	#�Xô F	#ôR*�~ô *ñ ÙƒIð ,Ø#3Ø%Ø!Ø&ñö
rD   