ó
    ×›‘hv@  ã                  óp  • S r SSKJr  SSKrSSKJrJr  SSKJr  SSKJ	r	J
r
JrJr  SSKJr  SSKJr  SS	KJrJrJr  SS
KJr  SSKJrJrJrJrJrJrJrJrJ r!J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SSK)J*r*J+r+J,r,J-r-J.r.  SSK/J0r1  SSK2J3r3  SSK4J5r5  SSK6J7r7  SSK8J9r9J:r:J;r;J<r<  SSK=J>r>  SSK?J@r@JArA  SSKBJCrC  SSKDJErEJ r    " S S\RŒ                  5      rG\ " S S\H5      5       rI " S S\RŒ                  5      rJ\" SS \JS!9rK\	\\\4   \./S4   rL\3" 5       rM " S" S#\RŒ                  \K   5      rN " S$ S%\RŒ                  \K   5      rO\" S S&9 " S' S(5      5       rP\S8S) j5       rQ\" \+5      \ " S* S+\
\K   5      5       5       rR\R\J   rS\QR¨                  S9S, j5       rU\QR¨                  S:S- j5       rV\QR¨                  S;S. j5       rW\QR¨                  S<S/ j5       rX\QR¨                  S=S0 j5       rY\QR¨                  S>S1 j5       rZ\QR¨                  S?S2 j5       r[\QR¨                  S@S3 j5       r\SAS4 jr] " S5 S6\C5      r^SBS7 jr_g)CzD
Private implementation module for public L{twisted.web.websocket}.
é    )ÚannotationsN)Ú	dataclassÚfield)Úsingledispatch)ÚCallableÚGenericÚTypeVarÚUnion)Úimplementer)ÚURL)Ú
ConnectionÚConnectionTypeÚWSConnection)ÚConnectionState)
ÚAcceptConnectionÚBytesMessageÚCloseConnectionÚEventÚPingÚPongÚRejectConnectionÚ
RejectDataÚRequestÚTextMessage)ÚH11Handshake)ÚRemoteProtocolError)ÚDeferred)Ú	IConsumerÚ	IProtocolÚIPushProducerÚIReactorTCPÚ
ITransport)ÚFactory)ÚLogger)ÚFailure)ÚBAD_REQUEST)ÚURIÚBrowserLikePolicyForHTTPSÚResponseÚ_StandardEndpointFactory)ÚHeaders)ÚIAgentEndpointFactoryÚIPolicyForHTTPS)ÚResource)ÚNOT_DONE_YETr   c                  ó\   • \ rS rSrSrSS jrSS jrSSS jjrSSS jjrSS jr	SS jr
S	rg
)ÚWebSocketTransporté<   z1
The transport that can send websocket messages.
c                ó   • g)z
Send a text message.
N© )ÚselfÚtexts     Ú_C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/web/_websocket_impl.pyÚsendTextMessageÚ"WebSocketTransport.sendTextMessageA   ó   � ó    c                ó   • g)z
Send a bytes message.
Nr4   ©r5   Údatas     r7   ÚsendBytesMessageÚ#WebSocketTransport.sendBytesMessageF   r:   r;   c                ó   • g)z 
Drop the websocket connection.
Nr4   )r5   Úcodes     r7   ÚloseConnectionÚ!WebSocketTransport.loseConnectionK   r:   r;   c                ó   • g)aÒ  
Send a websocket Ping request to measure latency.

@note: Per U{Mozilla's documentation
    <https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#pings_and_pongs_the_heartbeat_of_websockets>},
    multiple 'ping' requests may be coalesced into a single 'pong', and
    unsolicited 'pong' requests must be ignored, so we do not return a
    L{deferred <twisted.internet.defer.Deferred>} here; pongs are
    delivered separately.
Nr4   ©r5   Úpayloads     r7   ÚpingÚWebSocketTransport.pingP   r:   r;   c                ó   • g)z6
Attach the given L{IPushProducer} to this transport.
Nr4   ©r5   Úproducers     r7   ÚattachProducerÚ!WebSocketTransport.attachProducer\   r:   r;   c                ó   • g)zD
Detach a previously attached L{IPushProducer} from this transport.
Nr4   ©r5   s    r7   ÚdetachProducerÚ!WebSocketTransport.detachProducera   r:   r;   r4   N©r6   ÚstrÚreturnÚNone©r>   ÚbytesrU   rV   )éè  )rB   ÚintrU   rV   ©r;   ©rG   rX   rU   rV   ©rL   r    rU   rV   ©rU   rV   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r8   r?   rC   rH   rM   rQ   Ú__static_attributes__r4   r;   r7   r1   r1   <   s%   † ñôô
ö
ö

ô÷
r;   r1   c                  ó$   • \ rS rSr% SrS\S'   Srg)ÚConnectionRejectedég   z{
A websocket connection was rejected by an HTTP response.

@ivar response: The HTTP response that describes the rejection.
r)   Úresponser4   N)r_   r`   ra   rb   rc   Ú__annotations__rd   r4   r;   r7   rf   rf   g   s   ‡ ñð Ör;   rf   c                  óT   • \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS jr
S	rg
)ÚWebSocketProtocolér   a+  
An object that conforms to L{WebSocketProtocol} can receive all the events
from a websocket connection.

@note: While this is I{sort of} like a L{byte-stream protocol
    <twisted.internet.interfaces.IProtocol>}, the interface is distinct in
    a few ways; in particular, we have discrete C{negotiationStarted} and
    C{negotiationFinished} methods, representing those events in the
    websocket handshaking process, and no C{connectionMade}; similarly,
    since websockets can natively support both text and bytes messages,
    rather than fragmentable segments of a byte stream, we have
    C{textMessageReceived} and C{bytesMessageReceived} but no
    C{dataReceived}.  Finally, this is a L{typing.Protocol} and not a
    L{zope.interface.Interface}, since it does not predate the L{typing}
    module.
c                ó   • g)zz
An underlying transport (e.g.: a TCP connection) has been established;
negotiation of the websocket transport has begun.
Nr4   ©r5   Ú	transports     r7   ÚnegotiationStartedÚ$WebSocketProtocol.negotiationStarted„   r:   r;   c                ó   • g)zV
Negotiation is complete: a bidirectional websocket channel is now fully
established.
Nr4   rP   s    r7   ÚnegotiationFinishedÚ%WebSocketProtocol.negotiationFinishedŠ   r:   r;   c                ó   • g)a(  
A Pong message was received.

@note: Per U{the standard
    <https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2>}::

        A Pong frame sent in response to a Ping frame must have identical
        "Application data" as found in the message body of the Ping frame
        being replied to.

        If an endpoint receives a Ping frame and has not yet sent Pong
        frame(s) in response to previous Ping frame(s), the endpoint MAY
        elect to send a Pong frame for only the most recently processed
        Ping frame.

    Given that some Pong frames may be dropped, this event should only
    be used in concert with the transport's L{.ping
    <WebSocketTransport.ping>} method for its intended purpose, to
    measure latency and connection durability, not to transport
    application data.
Nr4   rF   s     r7   ÚpongReceivedÚWebSocketProtocol.pongReceived�   r:   r;   c                ó   • g)z,
A text message was received from the peer.
Nr4   )r5   Úmessages     r7   ÚtextMessageReceivedÚ%WebSocketProtocol.textMessageReceived§   r:   r;   c                ó   • g)z-
A bytes message was received from the peer.
Nr4   r=   s     r7   ÚbytesMessageReceivedÚ&WebSocketProtocol.bytesMessageReceived¬   r:   r;   c                ó   • g)z$
The websocket connection was lost.
Nr4   ©r5   Úreasons     r7   ÚconnectionLostÚ WebSocketProtocol.connectionLost±   r:   r;   r4   N)ro   r1   rU   rV   r^   r\   )ry   rT   rU   rV   rW   ©r�   r%   rU   rV   )r_   r`   ra   rb   rc   rp   rs   rv   rz   r}   r‚   rd   r4   r;   r7   rk   rk   r   s%   † ñô"ôôô.ô
÷
r;   rk   Ú_WSPT)Ú	covariantÚboundc                  ó"   • \ rS rSrSrSS jrSrg)ÚWebSocketServerFactoryé¼   z¢
A L{WebSocketServerFactory} is a factory for a particular kind of
L{WebSocketProtocol} that implements server-side websocket listeners via
L{WebSocketResource}.
c                ó   • g)zÿ
To conform to L{WebSocketServerFactory}, you must implement a
C{buildProtocol} method which takes a L{Request
<twisted.web.server.Request>} and returns a L{WebSocketProtocol}.

@return: a L{WebSocketProtocol} that will handle the inbound
    connection.
Nr4   )r5   Úrequests     r7   ÚbuildProtocolÚ$WebSocketServerFactory.buildProtocolÃ   r:   r;   r4   N)rŒ   r   rU   r…   ©r_   r`   ra   rb   rc   r�   rd   r4   r;   r7   r‰   r‰   ¼   ó   † ñ÷r;   r‰   c                  ó"   • \ rS rSrSrSS jrSrg)ÚWebSocketClientFactoryéÎ   z¨
A L{WebSocketClientFactory} is a factory for a particular kind of
L{WebSocketProtocol} that implements client-side websocket listeners via
L{WebSocketClientEndpoint}.
c                ó   • g)zó
To conform to L{WebSocketServerFactory}, you must implement a
C{buildProtocol} method which takes a string representing an URL and
returns a L{WebSocketProtocol}.

@return: a L{WebSocketProtocol} that will handle the outgoing
    connection.
Nr4   )r5   Úurls     r7   r�   Ú$WebSocketClientFactory.buildProtocolÕ   r:   r;   r4   N)r•   rT   rU   r…   r�   r4   r;   r7   r’   r’   Î   r�   r;   r’   )Úfrozenc                  óz   • \ rS rSr% SrS\S'    S\S'    \\" 5       SS4           SS jj5       rSS	 jr	S
r
g)ÚWebSocketClientEndpointéà   zœ
A L{WebSocketClientEndpoint} describes an URL to connect to and a way of
connecting to that URL, that can connect a L{WebSocketClientFactory} to
that URL.
r,   ÚendpointFactoryrT   r•   Nc                ó0   • [        XXE5      n[        Xb5      $ )aÙ  
Construct a L{WebSocketClientEndpoint} from a reactor and a URL.

@param reactor: The reactor to use for the TCP connection.

@param url: a string describing an URL where a websocket server lives.

@param tlsPolicy: The TLS policy to use for HTTPS connections.

@param connectTimeout: The number of seconds for the TCP-level
    connection timeout.

@param bindAddress: The bind address to use for the TCP client
    connections.

@return: the newly constructed endpoint.
)r*   r™   )ÚclsÚreactorr•   Ú	tlsPolicyÚconnectTimeoutÚbindAddressr›   s          r7   ÚnewÚWebSocketClientEndpoint.newò   s    € ô4 3Ø ó
ˆô ' Ó<Ð<r;   c              ƒ  óF  ^ ^^#   • T R                   R                  [        R                  " T R                  R                  S5      5      5      nSU 4S jjmUR                  [        R                  " UUU 4S j5      5      I Sh  v•N nUR                  I Sh  v•N $  N N7f)a-  
Make an outgoing connection to this L{WebSocketClientEndpoint}'s HTTPS
connection.

@param protocolFactory: The constructor for the protocol.

@return: A coroutine (that yields L{Deferred}s) that completes with the
    connected L{WebSocketProtocol} once the websocket connection is
    established.
zutf-8c                óâ   >• [         R                  " TR                  5      n[        UR	                  SSS S95      nUR                  U R                  [        UR                  U5      5      5        g )NÚ )ÚschemeÚhostÚport)	r   ÚfromTextr•   rT   ÚreplaceÚwriteÚsendÚ	WSRequestr¨   )ÚwscÚtÚhÚtargetr5   s       €r7   ÚclientBootstrapÚ8WebSocketClientEndpoint.connect.<locals>.clientBootstrap   sN   ø€ Ü—’˜TŸX™XÓ&ˆAÜ˜Ÿ™¨"°2¸D˜ÐAÓBˆFØ�G‰G�C—H‘HœY q§v¡v¨vÓ6Ó7Õ8r;   c                 ó~   >• [        [        [        R                  5      T TR	                  TR
                  5      5      $ ©N)Ú_WebSocketWireProtocolr   r   ÚCLIENTr�   r•   )r³   ÚprotocolFactoryr5   s   €€€r7   Ú<lambda>Ú1WebSocketClientEndpoint.connect.<locals>.<lambda>'  s.   ø€ Ô.Ü ¤×!6Ñ!6Ó7Ø#Ø#×1Ñ1°$·(±(Ó;ôr;   N©r¯   úWSConnection | Connectionr°   r"   rU   rV   )
r›   ÚendpointForURIr'   Ú	fromBytesr•   ÚencodeÚconnectÚProtocolFactoryÚforProtocolÚ_done)r5   r¹   ÚendpointÚ	connectedr³   s   ``  @r7   rÁ   ÚWebSocketClientEndpoint.connect  s€   úé € ð ×'Ñ'×6Ñ6Ü�MŠM˜$Ÿ(™(Ÿ/™/¨'Ó2Ó3ó
ˆ÷	9ð
 9A×8HÑ8HÜ×'Ò'öóó9
÷ 3
ˆ	ð —_‘_×$Ð$ñ3
ñ %ùs$   …A?B!ÂBÂB!ÂBÂB!ÂB!r4   )rž   r!   r•   rT   rŸ   r-   r    z
int | Noner¡   zbytes | NonerU   r™   )r¹   zWebSocketClientFactory[_WSP]rU   r…   )r_   r`   ra   rb   rc   ri   Úclassmethodr(   r¢   rÁ   rd   r4   r;   r7   r™   r™   à   s�   ‡ ñð +Ó*ðð 
ƒHðð ñ
 &?Ó%@Ø%)Ø$(ð=àð=ð ð=ð #ð	=ð
 #ð=ð "ð=ð 
!ô=ó ð=÷<%r;   r™   c                ó   • g)z$
Handle a websocket protocol event.
Nr4   ©ÚeventÚprotos     r7   Ú_handleEventrÍ   1  r:   r;   c                  óî   • \ rS rSr% S\S'   S\S'   S\S'   \" SS	9rS
\S'   \" SS	9rS\S'   SrS\S'   SS jr	SS jr
S S jrS!S jrS"S jrS S jrS#S$S jjrS%S&S jjrS'S jrSS jrSS jrSS jrSrg)(r·   i8  r½   Ú_wsconnÚ
_BootstrapÚ
_bootstrapr…   Ú_wspF)Úinitr"   ro   zDeferred[_WSP]rÄ   NzResponse | NoneÚ_rejectResponsec                óN   • Xl         [        5       U l        U R                  5         g r¶   )ro   r   rÄ   ÚconnectionMadern   s     r7   ÚmakeConnectionÚ%_WebSocketWireProtocol.makeConnectionG  s   € Ø"ŒÜ“ZˆŒ
Ø×ÑÕr;   c                ó†   • U R                   R                  U 5        U R                  U R                  U R                  5        g r¶   )rÒ   rp   rÑ   rÏ   ro   rP   s    r7   rÖ   Ú%_WebSocketWireProtocol.connectionMadeL  s*   € à�	‰	×$Ñ$ TÔ*Ø�‰˜Ÿ™ d§n¡nÕ5r;   c                ó’   • U R                   R                  U5        U R                   R                  5        H  n[        X 5        M     g r¶   )rÏ   Úreceive_dataÚeventsrÍ   )r5   r>   rË   s      r7   ÚdataReceivedÚ#_WebSocketWireProtocol.dataReceivedQ  s3   € Ø�‰×!Ñ! $Ô'Ø—\‘\×(Ñ(Ö*ˆEÜ˜Ö%ò +r;   c                óš   • U R                   R                  U5        U R                  b#  U R                  R                  U5        S U l        g g r¶   )rÒ   r‚   rÔ   Ú_bodyDataFinishedr€   s     r7   r‚   Ú%_WebSocketWireProtocol.connectionLostV  sA   € Ø�	‰	× Ñ  Ô(Ø×ÑÑ+Ø× Ñ ×2Ñ2°6Ô:Ø#'ˆDÕ ð ,r;   c                óŒ   • U R                   nUc   eUR                  U R                  R                  [	        U5      5      5        g r¶   )ro   r¬   rÏ   r­   r   )r5   r6   r°   s      r7   r8   Ú&_WebSocketWireProtocol.sendTextMessage]  s5   € Ø�N‰NˆØ‰}Ðˆ}Ø	�‰�—‘×!Ñ!¤+¨dÓ"3Ó4Õ5r;   c                óŒ   • U R                   nUc   eUR                  U R                  R                  [	        U5      5      5        g r¶   )ro   r¬   rÏ   r­   r   )r5   r>   r°   s      r7   r?   Ú'_WebSocketWireProtocol.sendBytesMessageb  s5   € Ø�N‰NˆØ‰}Ðˆ}Ø	�‰�—‘×!Ñ!¤,¨tÓ"4Ó5Õ6r;   c                óŒ   • U R                   nUc   eUR                  U R                  R                  [	        U5      5      5        g r¶   )ro   r¬   rÏ   r­   r   )r5   rG   r°   s      r7   rH   Ú_WebSocketWireProtocol.pingg  s4   € Ø�N‰NˆØ‰}Ðˆ}Ø	�‰�—‘×!Ñ!¤$ w£-Ó0Õ1r;   c                ó¬   • U R                   nUc   eUR                  U R                  R                  [	        X5      5      5        UR                  5         g r¶   )ro   r¬   rÏ   r­   r   rC   )r5   rB   r�   r°   s       r7   rC   Ú%_WebSocketWireProtocol.loseConnectionl  sA   € Ø�N‰NˆØ‰}Ðˆ}Ø	�‰�—‘×!Ñ!¤/°$Ó"?Ó@ÔAØ	×ÑÕr;   c                óN   • [        U R                  5      R                  US5        g )NT)r   ro   ÚregisterProducerrK   s     r7   rM   Ú%_WebSocketWireProtocol.attachProducerr  s   € Ü�$—.‘.Ó!×2Ñ2°8¸TÕBr;   c                óJ   • [        U R                  5      R                  5         g r¶   )r   ro   ÚunregisterProducerrP   s    r7   rQ   Ú%_WebSocketWireProtocol.detachProduceru  s   € Ü�$—.‘.Ó!×4Ñ4Õ6r;   c                óŠ   • U R                   nU ? UR                  U R                  5        U R                  R                  5         g r¶   )rÄ   ÚcallbackrÒ   rs   ©r5   Údones     r7   Ú_completeConnectionÚ*_WebSocketWireProtocol._completeConnectionx  s0   € Ø�z‰zˆØˆJØ�‰�d—i‘iÔ Ø�	‰	×%Ñ%Õ'r;   c                ó†   • U R                   c   eU R                  nU ?UR                  [        U R                   5      5        g r¶   )rÔ   rÄ   Úerrbackrf   ró   s     r7   Ú_rejectConnectionÚ(_WebSocketWireProtocol._rejectConnection~  s:   € Ø×#Ñ#Ñ/Ð/Ð/Ø�z‰zˆØˆJØ�‰Ô'¨×(<Ñ(<Ó=Õ>r;   )rÄ   rÔ   ro   )ro   r"   rU   rV   r^   rW   r„   rS   r[   r\   )rY   r¦   )rB   rZ   r�   rT   rU   rV   r]   )r_   r`   ra   rb   ri   r   ro   rÄ   rÔ   r×   rÖ   rÞ   r‚   r8   r?   rH   rC   rM   rQ   rõ   rù   rd   r4   r;   r7   r·   r·   8  s~   ‡ ð 'Ó&ØÓØ
ƒJñ " uÑ-€IˆzÓ-ñ " uÑ-€Eˆ>Ó-Ø'+€O�_Ó+ôô
6ô
&ô
(ô6ô
7ö
2ö
ôCô7ô(÷?r;   r·   c                ó$   • UR                  5         g r¶   )rõ   rÊ   s     r7   Ú_handle_acceptConnectionrü   ˆ  s   € à	×ÑÕr;   c                óÒ   • [        5       nU R                   H  u  p4UR                  X45        M     [        SU R                  SX!R
                  5      Ul        UR                  5         g )Nz1.1r¦   )r+   ÚheadersÚaddRawHeaderr)   Ústatus_codero   rÔ   rù   )rË   rÌ   ÚhdrÚkÚvs        r7   Ú_handle_rejectConnectionr  �  sP   € ä
‹)€CØ—”‰ˆØ×Ñ˜Öñ ä$ U¨E×,=Ñ,=¸rÀ3ÏÉÓX€EÔØ	×ÑÕr;   c                óÎ   • UR                   c   S5       eUR                   R                  U R                  5        U R                  (       a  UR                  R                  5         g g )Nz7response should never be None when receiving RejectData)rÔ   Ú_bodyDataReceivedr>   Úbody_finishedro   rC   rÊ   s     r7   Ú_handle_rejectDatar  –  sX   € ð 	×ÑÑ)ðAà@óAØ)à	×Ñ×+Ñ+¨E¯J©JÔ7Ø××Ø�‰×&Ñ&Õ(ð r;   c                óN   • UR                   R                  U R                  5        g r¶   )rÒ   rz   r>   rÊ   s     r7   Ú_handle_textMessager
     s   € à	‡J�J×"Ñ" 5§:¡:Õ.r;   c                óN   • UR                   R                  U R                  5        g r¶   )rÒ   r}   r>   rÊ   s     r7   Ú_handle_bytesMessager  ¥  s   € à	‡J�J×#Ñ# E§J¡JÕ/r;   c                óˆ   • UR                   R                  UR                  R                  U R	                  5       5      5        g r¶   )ro   r¬   rÏ   r­   rh   rÊ   s     r7   Ú_handle_pingr  ª  s*   € à	‡O�O×Ñ˜%Ÿ-™-×,Ñ,¨U¯^©^Ó-=Ó>Õ?r;   c                óN   • UR                   R                  U R                  5        g r¶   )rÒ   rv   rG   rÊ   s     r7   Ú_handle_pongr  ¯  s   € à	‡J�J×Ñ˜EŸM™MÕ*r;   c                ó*  • UR                   c   eUR                  R                  [        R                  :w  aB  UR                   R                  UR                  R                  U R                  5       5      5        UR                   R                  5         g r¶   )	ro   rÏ   Ústater   ÚCLOSEDr¬   r­   rh   rC   rÊ   s     r7   Ú_handle_closeConnectionr  ´  sb   € à�?‰?Ñ&Ð&Ð&Ø‡}�}×Ñœo×4Ñ4Ó4Ø�‰×Ñ˜eŸm™m×0Ñ0°·±Ó1AÓBÔCØ	‡O�O×"Ñ"Õ$r;   c                óR   • U R                  [        5        U R                  SS5        g)Nzcontent-typez
text/plains$   websocket protocol negotiation error)ÚsetResponseCoder&   Ú	setHeader)rŒ   s    r7   Ú_negotiationErrorr  ¼  s#   € Ø×ÑœKÔ(Ø×Ñ�n lÔ3Ø2r;   c                  ó:   ^ • \ rS rSrSrSU 4S jjrSS jrSrU =r$ )ÚWebSocketResourceiÂ  z�
A L{WebSocketResource} is a L{Resource} that presents a websocket listener.
You can install it into any twisted web server resource hierarchy.
c                ó.   >• [         TU ]  5         Xl        g)zû
Create a L{WebSocketResource} that will respond to incoming connections
with the given L{WebSocketServerFactory}.

@param factory: The factory that will be used to respond to inbound
    websocket connections on appropriately formatted GET requests.
N)ÚsuperÚ__init__Úfactory)r5   r  Ú	__class__s     €r7   r  ÚWebSocketResource.__init__È  s   ø€ ô 	‰ÑÔØ�r;   c                óî  • [        [        R                  5      nUR                  R	                  5       nU VVVs/ s H  u  pEU  H  odU4PM     M     nnnn UR                  XqR                  5        U R                  R                  U5      n	U	c   S5       eUR                  [        5       5      n
UR                  nUR                   R"                  nUc   S5       eUc   S5       e[%        U[&        U	5      nUR                   R)                  U5        UR+                  U
5        U	R-                  5         [.        $ s  snnnf ! [         a)  n[        R                  SXS9  [        U5      s SnA$ SnAff = f)z^
This implementation of the C{GET} HTTP method will respond to inbound
websocket connections.
z{request} failed with {rpe})rŒ   ÚrpeNz"connection not accepted by twistedzchannel transport not connectedz"connection not accepted by wsproto)r   r   ÚSERVERÚrequestHeadersÚgetAllRawHeadersÚinitiate_upgrade_connectionÚpathr   Ú_logÚerrorr  r  r�   r­   r   Ú
connectionÚchannelro   r·   ÚserverBootstrapÚ_protocolUpgradeForWebsocketsr¬   rs   r/   )r5   rŒ   Ú	handshakeÚrawÚhkeyÚhvalsÚvalÚsimpleHeadersr"  ÚwsprotÚtoSendÚwsconr°   Ú	wireProtos                 r7   Ú
render_GETÚWebSocketResource.render_GETÓ  sF  € ô
 !¤×!6Ñ!6Ó7ˆ	Ø×$Ñ$×5Ñ5Ó7ˆÙ8;ÕMº©¨ÄuÀ ›Áu™¹ˆÒMð	.Ø×1Ñ1°-ÇÁÔNð —‘×+Ñ+¨GÓ4ˆØÑ!ÐGÐ#GÓGÐ!Ø—‘Ô 0Ó 2Ó3ˆØ×$Ñ$ˆØ�O‰O×%Ñ%ˆØ‰}Ð?Ð?Ó?ˆ}ØÑ ÐFÐ"FÓFÐ Ü*¨5´/À6ÓJˆ	Ø�‰×5Ñ5°iÔ@Ø	�‰�ŒØ×"Ñ"Ô$ÜÐùô# Nøô #ó 	.Ü�J‰JÐ4¸gˆJÑOÜ$ WÓ-Õ-ûð	.ús#   ºD:ÁE Å
E4ÅE/Å)E4Å/E4)r  )r  z)WebSocketServerFactory[WebSocketProtocol]rU   rV   )rŒ   r   rU   zbytes | int)	r_   r`   ra   rb   rc   r  r8  rd   Ú__classcell__)r  s   @r7   r  r  Â  s   ø† ñ÷
	÷ò r;   r  c                ó   • g)z;
The server requires no bootstrapping, so this is a no-op.
Nr4   )r¯   r°   s     r7   r,  r,  î  r:   r;   )rË   r   rÌ   ÚAnyWSWPrU   rV   )rË   r   rÌ   r<  rU   rV   )rË   r   rÌ   r<  rU   rV   )rË   r   rÌ   r<  rU   rV   )rË   r   rÌ   r<  rU   rV   )rË   r   rÌ   r<  rU   rV   )rË   r   rÌ   r<  rU   rV   )rË   r   rÌ   r<  rU   rV   )rË   r   rÌ   r<  rU   rV   )rŒ   r   rU   rX   r¼   )`rc   Ú
__future__r   ÚtypingÚdataclassesr   r   Ú	functoolsr   r   r   r	   r
   Úzope.interfacer   Ú	hyperlinkr   Úwsprotor   r   r   Úwsproto.connectionr   Úwsproto.eventsr   r   r   r   r   r   r   r   r   r®   r   Úwsproto.handshaker   Úwsproto.utilitiesr   Útwisted.internet.deferr   Útwisted.internet.interfacesr   r   r    r!   r"   Útwisted.internet.protocolr#   rÂ   Útwisted.loggerr$   Útwisted.python.failurer%   Útwisted.web._responsesr&   Útwisted.web.clientr'   r(   r)   r*   Útwisted.web.http_headersr+   Útwisted.web.iwebr,   r-   Útwisted.web.resourcer.   Útwisted.web.serverr/   ÚProtocolr1   Ú	Exceptionrf   rk   r…   rÐ   r(  r‰   r’   r™   rÍ   r·   r<  Úregisterrü   r  r  r
  r  r  r  r  r  r  r,  r4   r;   r7   Ú<module>rV     ss  ðñ
õ #ã ß (Ý $ß 4Ó 4å &å ß <Ñ <Ý .÷÷ ÷ õ +Ý 1å +÷õ õ AÝ !Ý *Ý .÷ó õ -ß CÝ )ß 4ô(˜Ÿ™ô (ðV ô˜ó ó ðôB˜Ÿ™ô BñJ ˆv Ð->Ñ?€Ø�u˜\¨:Ð5Ñ6¸
ÐCÀTÐIÑJ€
Ùƒx€ô˜VŸ_™_¨TÑ2ô ô$˜VŸ_™_¨TÑ2ô ñ$ �$Ñ÷M%ð M%ó ðM%ð` óó ðñ ˆYÓØ
ôH?˜W T™]ó H?ó ó ðH?ðV !Ð!2Ñ
3€ð ×Ñó ó ð ð ×Ñóó ðð ×Ñó)ó ð)ð ×Ñó/ó ð/ð ×Ñó0ó ð0ð ×Ñó@ó ð@ð ×Ñó+ó ð+ð ×Ñó%ó ð%ô3ô)˜ô )õXr;   