+
    üÐjv@  ã                  óÄ  € R t ^ RIHt ^ RIt^ RIHtHt ^ RIHt ^ RIH	t	H
t
HtHt ^ RIHt ^ RIHt ^ RIHtHtHt ^ R	IHt ^ R
IHtHtHtHtHtHtHtHtH t!H"t" ^ RI#H$t$ ^ RI%H&t& ^ RI'H(t( ^ RI)H*t*H+t+H,t,H-t-H.t. ^ RI/H0t1 ^ RI2H3t3 ^ RI4H5t5 ^ RI6H7t7 ^ RI8H9t9H:t:H;t;H<t< ^ RI=H>t> ^ RI?H@t@HAtA ^ RIBHCtC ^ RIDHEtEH t   ! R R]PŒ                  4      tG] ! R R]H4      4       tI ! R R]PŒ                  4      tJ]! RR]JR 7      tK]	]]]3,          ]..R3,          tL]3! 4       tM ! R! R"]PŒ                  ]K,          4      tN ! R# R$]PŒ                  ]K,          4      tO]! RR%7       ! R& R'4      4       tP]R( R) l4       tQ]! ]+4      ] ! R* R+]
]K,          4      4       4       tR]R]J,          tS]QP¨                  R, R- l4       tU]QP¨                  R. R/ l4       tV]QP¨                  R0 R1 l4       tW]QP¨                  R2 R3 l4       tX]QP¨                  R4 R5 l4       tY]QP¨                  R6 R7 l4       tZ]QP¨                  R8 R9 l4       t[]QP¨                  R: R; l4       t\R< R= lt] ! R> R?]C4      t^R@ RA lt_R# )BzD
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                  ój   € ] tR t^<tRtR R ltR R ltRR R lltRR R	 lltR
 R lt	R R lt
RtR# )ÚWebSocketTransportz1
The transport that can send websocket messages.
c               ó    € V ^8„  d   QhRRRR/# ©é   ÚtextÚstrÚreturnÚNone© )Úformats   "Ú=/usr/lib/python3/dist-packages/twisted/web/_websocket_impl.pyÚ__annotate__ÚWebSocketTransport.__annotate__A   s   € ÷ ñ  Cð ¨Dñ ó    c                ó   € R# )z
Send a text message.
Nr8   )Úselfr4   s   &&r:   ÚsendTextMessageÚ"WebSocketTransport.sendTextMessageA   ó   ‚ r=   c               ó    € V ^8„  d   QhRRRR/# ©r3   ÚdataÚbytesr6   r7   r8   )r9   s   "r:   r;   r<   F   s   € ÷ ñ  Uð ¨tñ r=   c                ó   € R# )z
Send a bytes message.
Nr8   ©r?   rE   s   &&r:   ÚsendBytesMessageÚ#WebSocketTransport.sendBytesMessageF   rB   r=   c               ó    € V ^8„  d   QhRRRR/# )r3   ÚcodeÚintr6   r7   r8   )r9   s   "r:   r;   r<   K   s   € ÷ ñ  3ð °$ñ r=   c                ó   € R# )z 
Drop the websocket connection.
Nr8   )r?   rL   s   &&r:   ÚloseConnectionÚ!WebSocketTransport.loseConnectionK   rB   r=   c               ó    € V ^8„  d   QhRRRR/# ©r3   ÚpayloadrF   r6   r7   r8   )r9   s   "r:   r;   r<   P   s   € ÷ 
ñ 
˜Eð 
¨Dñ 
r=   c                ó   € R# )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.
Nr8   ©r?   rS   s   &&r:   ÚpingÚWebSocketTransport.pingP   rB   r=   c               ó    € V ^8„  d   QhRRRR/# ©r3   Úproducerr   r6   r7   r8   )r9   s   "r:   r;   r<   \   s   € ÷ ñ  }ð ¸ñ r=   c                ó   € R# )z6
Attach the given L{IPushProducer} to this transport.
Nr8   ©r?   rZ   s   &&r:   ÚattachProducerÚ!WebSocketTransport.attachProducer\   rB   r=   c               ó   € V ^8„  d   QhRR/# ©r3   r6   r7   r8   )r9   s   "r:   r;   r<   a   s   € ÷ ñ  ñ r=   c                ó   € R# )zD
Detach a previously attached L{IPushProducer} from this transport.
Nr8   ©r?   s   &r:   ÚdetachProducerÚ!WebSocketTransport.detachProducera   rB   r=   r8   N)éè  ©r=   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r@   rI   rO   rV   r]   rc   Ú__static_attributes__r8   r=   r:   r0   r0   <   s*   † ñõõ
÷
÷

õ÷
ñ r=   r0   c                  ó&   € ] tR t^gt$ RtR]R&   RtR# )ÚConnectionRejectedz{
A websocket connection was rejected by an HTTP response.

@ivar response: The HTTP response that describes the rejection.
r(   Úresponser8   N)rg   rh   ri   rj   rk   Ú__annotations__rl   r8   r=   r:   rn   rn   g   s   ‡ ñð ×r=   rn   c                  ób   € ] tR t^rtRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
RtR# )ÚWebSocketProtocola+  
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               ó    € V ^8„  d   QhRRRR/# )r3   Ú	transportr0   r6   r7   r8   )r9   s   "r:   r;   ÚWebSocketProtocol.__annotate__„   s   € ÷ ñ Ð,>ð À4ñ r=   c                ó   € R# )zz
An underlying transport (e.g.: a TCP connection) has been established;
negotiation of the websocket transport has begun.
Nr8   ©r?   rt   s   &&r:   ÚnegotiationStartedÚ$WebSocketProtocol.negotiationStarted„   rB   r=   c               ó   € V ^8„  d   QhRR/# r`   r8   )r9   s   "r:   r;   ru   Š   s   € ÷ ñ  Tñ r=   c                ó   € R# )zV
Negotiation is complete: a bidirectional websocket channel is now fully
established.
Nr8   rb   s   &r:   ÚnegotiationFinishedÚ%WebSocketProtocol.negotiationFinishedŠ   rB   r=   c               ó    € V ^8„  d   QhRRRR/# rR   r8   )r9   s   "r:   r;   ru   �   s   € ÷ ñ  Eð ¨dñ r=   c                ó   € R# )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.
Nr8   rU   s   &&r:   ÚpongReceivedÚWebSocketProtocol.pongReceived�   rB   r=   c               ó    € V ^8„  d   QhRRRR/# )r3   Úmessager5   r6   r7   r8   )r9   s   "r:   r;   ru   §   s   € ÷ ñ ¨3ð °4ñ r=   c                ó   € R# )z,
A text message was received from the peer.
Nr8   )r?   rƒ   s   &&r:   ÚtextMessageReceivedÚ%WebSocketProtocol.textMessageReceived§   rB   r=   c               ó    € V ^8„  d   QhRRRR/# rD   r8   )r9   s   "r:   r;   ru   ¬   s   € ÷ ñ ¨ð °4ñ r=   c                ó   € R# )z-
A bytes message was received from the peer.
Nr8   rH   s   &&r:   ÚbytesMessageReceivedÚ&WebSocketProtocol.bytesMessageReceived¬   rB   r=   c               ó    € V ^8„  d   QhRRRR/# ©r3   Úreasonr$   r6   r7   r8   )r9   s   "r:   r;   ru   ±   s   € ÷ ñ  Wð °ñ r=   c                ó   € R# )z$
The websocket connection was lost.
Nr8   ©r?   r�   s   &&r:   ÚconnectionLostÚ WebSocketProtocol.connectionLost±   rB   r=   r8   N)rg   rh   ri   rj   rk   rx   r|   r€   r…   r‰   r�   rl   r8   r=   r:   rr   rr   r   s*   † ñõ"õõõ.õ
÷
ñ r=   rr   Ú_WSPT)Ú	covariantÚboundc                  ó&   € ] tR t^¼tRtR R ltRtR# )ÚWebSocketServerFactoryz¢
A L{WebSocketServerFactory} is a factory for a particular kind of
L{WebSocketProtocol} that implements server-side websocket listeners via
L{WebSocketResource}.
c               ó    € V ^8„  d   QhRRRR/# )r3   Úrequestr   r6   r’   r8   )r9   s   "r:   r;   Ú#WebSocketServerFactory.__annotate__Ã   s   € ÷ ñ  Wð °ñ r=   c                ó   € R# )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.
Nr8   )r?   r˜   s   &&r:   ÚbuildProtocolÚ$WebSocketServerFactory.buildProtocolÃ   rB   r=   r8   N©rg   rh   ri   rj   rk   r›   rl   r8   r=   r:   r–   r–   ¼   ó   † ñ÷ñ r=   r–   c                  ó&   € ] tR t^ÎtRtR R ltRtR# )ÚWebSocketClientFactoryz¨
A L{WebSocketClientFactory} is a factory for a particular kind of
L{WebSocketProtocol} that implements client-side websocket listeners via
L{WebSocketClientEndpoint}.
c               ó    € V ^8„  d   QhRRRR/# )r3   Úurlr5   r6   r’   r8   )r9   s   "r:   r;   Ú#WebSocketClientFactory.__annotate__Õ   s   € ÷ ñ  ð ¨ñ r=   c                ó   € R# )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.
Nr8   )r?   r¢   s   &&r:   r›   Ú$WebSocketClientFactory.buildProtocolÕ   rB   r=   r8   Nr�   r8   r=   r:   r    r    Î   rž   r=   r    )Úfrozenc                  ój   € ] tR t^àt$ RtR]R&    R]R&    ]]! 4       RR3R R ll4       tR	 R
 lt	Rt
R# )ÚWebSocketClientEndpointzœ
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+   ÚendpointFactoryr5   r¢   Nc               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# )r3   Úreactorr    r¢   r5   Ú	tlsPolicyr,   ÚconnectTimeoutz
int | NoneÚbindAddresszbytes | Noner6   r¨   r8   )r9   s   "r:   r;   Ú$WebSocketClientEndpoint.__annotate__ó   sF   € ÷ =ñ =àð=ð ð=ð #ð	=ð
 #ð=ð "ð=ð 
!ñ=r=   c                ó0   € \        WWE4      p\        Wb4      # )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¨   )Úclsr«   r¢   r¬   r­   r®   r©   s   &&&&&& r:   ÚnewÚWebSocketClientEndpoint.newò   s    € ô4 3Ø ó
ˆô ' Ó<Ð<r=   c               ó    € V ^8„  d   QhRRRR/# )r3   ÚprotocolFactoryzWebSocketClientFactory[_WSP]r6   r’   r8   )r9   s   "r:   r;   r¯     s   € ÷ %ñ %Ð-Ið %Èdñ %r=   c              ƒ  óH  a aa"  € S P                   P                  \        P                  ! S P                  P                  R4      4      4      pR V 3R lloVP                  \        P                  ! VVV 3R l4      4      G Rj  x€L
 pVP                  G Rj  x€L
 #  L L5i)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               ó$   € V ^8„  d   QhRRRRRR/# ©r3   ÚwscúWSConnection | ConnectionÚtr!   r6   r7   r8   )r9   s   "r:   r;   Ú5WebSocketClientEndpoint.connect.<locals>.__annotate__   s"   € ÷ 	9ñ 	9Ð!:ð 	9¸zð 	9Èdñ 	9r=   c                óê   <€ \         P                  ! SP                  4      p\        VP	                  R R RR7      4      pVP                  V P                  \        VP                  V4      4      4       R# )Ú N)ÚschemeÚhostÚport)	r   ÚfromTextr¢   r5   ÚreplaceÚwriteÚsendÚ	WSRequestrÀ   )r¹   r»   ÚhÚtargetr?   s   &&  €r:   Ú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                 ó~   <€ \        \        \        P                  4      S SP	                  SP
                  4      4      # ©N)Ú_WebSocketWireProtocolr   r   ÚCLIENTr›   r¢   )rÉ   rµ   r?   s   €€€r:   Ú<lambda>Ú1WebSocketClientEndpoint.connect.<locals>.<lambda>'  s.   ø€ Ô.Ü ¤×!6Ñ!6Ó7Ø#Ø#×1Ñ1°$·(±(Ó;ôr=   N)
r©   ÚendpointForURIr&   Ú	fromBytesr¢   ÚencodeÚconnectÚProtocolFactoryÚforProtocolÚ_done)r?   rµ   ÚendpointÚ	connectedrÉ   s   ff  @r:   rÔ   ÚWebSocketClientEndpoint.connect  s…   úé € ð ×'Ñ'×6Ñ6Ü�MŠM˜$Ÿ(™(Ÿ/™/¨'Ó2Ó3ó
ˆ÷	9ð 	9ð
 9A×8HÑ8HÜ×'Ò'öóó9
÷ 3
ˆ	ð —_‘_×$Ð$ñ3
ñ %ùs$   …B B"ÂBÂB"ÂB ÂB"Â B"r8   )rg   rh   ri   rj   rk   rp   Úclassmethodr'   r²   rÔ   rl   r8   r=   r:   r¨   r¨   à   sL   ‡ ñð +Ó*ðð 
ƒHðð ñ
 &?Ó%@Ø%)Ø$(ö=ó ð=÷<%ñ %r=   r¨   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   Úeventr   ÚprotoÚAnyWSWPr6   r7   r8   )r9   s   "r:   r;   r;   2  s!   € ÷ ñ ˜ð  gð °$ñ r=   c                ó   € R# )z$
Handle a websocket protocol event.
Nr8   ©rÝ   rÞ   s   &&r:   Ú_handleEventrâ   1  rB   r=   c                  ó  € ] tR tRt$ R]R&   R]R&   R]R&   ]! RR	7      tR
]R&   ]! RR	7      tR]R&   RtR]R&   R R lt	R R lt
R R ltR R ltR R ltR R ltR*R R lltR+R R  lltR! R" ltR# R$ ltR% R& ltR' R( ltR)tR# ),rÍ   i8  rº   Ú_wsconnÚ
_BootstrapÚ
_bootstrapr’   Ú_wspF)Úinitr!   rt   zDeferred[_WSP]r×   NzResponse | NoneÚ_rejectResponsec               ó    € V ^8„  d   QhRRRR/# )r3   rt   r!   r6   r7   r8   )r9   s   "r:   r;   Ú#_WebSocketWireProtocol.__annotate__G  s   € ÷ ñ ¨
ð °tñ r=   c                	óP   € Wn         \        4       V n        V P                  4        R # rÌ   )rt   r   r×   ÚconnectionMaderw   s   &&r:   ÚmakeConnectionÚ%_WebSocketWireProtocol.makeConnectionG  s   € Ø"ŒÜ“ZˆŒ
Ø×ÑÖr=   c               ó   € V ^8„  d   QhRR/# r`   r8   )r9   s   "r:   r;   rë   L  s   € ÷ 6ñ 6 ñ 6r=   c                	óˆ   € V P                   P                  V 4       V P                  V P                  V P                  4       R # rÌ   )rç   rx   ræ   rä   rt   rb   s   &r:   rí   Ú%_WebSocketWireProtocol.connectionMadeL  s*   € à�	‰	×$Ñ$ TÔ*Ø�‰˜Ÿ™ d§n¡nÖ5r=   c               ó    € V ^8„  d   QhRRRR/# rD   r8   )r9   s   "r:   r;   rë   Q  s   € ÷ &ñ & ð &¨4ñ &r=   c                	ó”   € V P                   P                  V4       V P                   P                  4        F  p\        W 4       K  	  R # rÌ   )rä   Úreceive_dataÚeventsrâ   )r?   rE   rÝ   s   && r:   ÚdataReceivedÚ#_WebSocketWireProtocol.dataReceivedQ  s3   € Ø�‰×!Ñ! $Ô'Ø—\‘\×(Ñ(Ö*ˆEÜ˜Ö%ó +r=   c               ó    € V ^8„  d   QhRRRR/# rŒ   r8   )r9   s   "r:   r;   rë   V  s   € ÷ (ñ ( Wð (°ñ (r=   c                	ó    € V P                   P                  V4       V P                  e%   V P                  P                  V4       R V n        R # R # rÌ   )rç   r�   ré   Ú_bodyDataFinishedr�   s   &&r:   r�   Ú%_WebSocketWireProtocol.connectionLostV  sA   € Ø�	‰	× Ñ  Ô(Ø×ÑÒ+Ø× Ñ ×2Ñ2°6Ô:Ø#'ˆDÖ ñ ,r=   c               ó    € V ^8„  d   QhRRRR/# r2   r8   )r9   s   "r:   r;   rë   ]  s   € ÷ 6ñ 6 Cð 6¨Dñ 6r=   c                	ó�   € V P                   pVf   Q hVP                  V P                  P                  \	        V4      4      4       R # rÌ   )rt   rÄ   rä   rÅ   r   )r?   r4   r»   s   && r:   r@   Ú&_WebSocketWireProtocol.sendTextMessage]  s5   € Ø�N‰NˆØŠ}Ðˆ}Ø	�‰�—‘×!Ñ!¤+¨dÓ"3Ó4Ö5r=   c               ó    € V ^8„  d   QhRRRR/# rD   r8   )r9   s   "r:   r;   rë   b  s   € ÷ 7ñ 7 Uð 7¨tñ 7r=   c                	ó�   € V P                   pVf   Q hVP                  V P                  P                  \	        V4      4      4       R # rÌ   )rt   rÄ   rä   rÅ   r   )r?   rE   r»   s   && r:   rI   Ú'_WebSocketWireProtocol.sendBytesMessageb  s5   € Ø�N‰NˆØŠ}Ðˆ}Ø	�‰�—‘×!Ñ!¤,¨tÓ"4Ó5Ö6r=   c               ó    € V ^8„  d   QhRRRR/# rR   r8   )r9   s   "r:   r;   rë   g  s   € ÷ 2ñ 2˜Eð 2¨Dñ 2r=   c                	ó�   € V P                   pVf   Q hVP                  V P                  P                  \	        V4      4      4       R # rÌ   )rt   rÄ   rä   rÅ   r   )r?   rS   r»   s   && r:   rV   Ú_WebSocketWireProtocol.pingg  s4   € Ø�N‰NˆØŠ}Ðˆ}Ø	�‰�—‘×!Ñ!¤$ w£-Ó0Ö1r=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rL   rM   r�   r5   r6   r7   r8   )r9   s   "r:   r;   rë   l  s!   € ÷ ñ  3ð °sð ÀDñ r=   c                	ó°   € V P                   pVf   Q hVP                  V P                  P                  \	        W4      4      4       VP                  4        R # rÌ   )rt   rÄ   rä   rÅ   r   rO   )r?   rL   r�   r»   s   &&& r:   rO   Ú%_WebSocketWireProtocol.loseConnectionl  sA   € Ø�N‰NˆØŠ}Ðˆ}Ø	�‰�—‘×!Ñ!¤/°$Ó"?Ó@ÔAØ	×ÑÖr=   c               ó    € V ^8„  d   QhRRRR/# rY   r8   )r9   s   "r:   r;   rë   r  s   € ÷ Cñ C }ð C¸ñ Cr=   c                	óP   € \        V P                  4      P                  VR 4       R# )TN)r   rt   ÚregisterProducerr\   s   &&r:   r]   Ú%_WebSocketWireProtocol.attachProducerr  s   € Ü�$—.‘.Ó!×2Ñ2°8¸TÖBr=   c               ó   € V ^8„  d   QhRR/# r`   r8   )r9   s   "r:   r;   rë   u  s   € ÷ 7ñ 7 ñ 7r=   c                	óL   € \        V P                  4      P                  4        R # rÌ   )r   rt   ÚunregisterProducerrb   s   &r:   rc   Ú%_WebSocketWireProtocol.detachProduceru  s   € Ü�$—.‘.Ó!×4Ñ4Ö6r=   c               ó   € V ^8„  d   QhRR/# r`   r8   )r9   s   "r:   r;   rë   x  s   € ÷ (ñ ( Tñ (r=   c                	óŒ   € V P                   pV = VP                  V P                  4       V P                  P                  4        R # rÌ   )r×   Úcallbackrç   r|   ©r?   Údones   & r:   Ú_completeConnectionÚ*_WebSocketWireProtocol._completeConnectionx  s0   € Ø�z‰zˆØˆJØ�‰�d—i‘iÔ Ø�	‰	×%Ñ%Ö'r=   c               ó   € V ^8„  d   QhRR/# r`   r8   )r9   s   "r:   r;   rë   ~  s   € ÷ ?ñ ? 4ñ ?r=   c                	óŠ   € V P                   f   Q hV P                  pV =VP                  \        V P                   4      4       R # rÌ   )ré   r×   Úerrbackrn   r  s   & r:   Ú_rejectConnectionÚ(_WebSocketWireProtocol._rejectConnection~  s:   € Ø×#Ñ#Ò/Ð/Ð/Ø�z‰zˆØˆJØ�‰Ô'¨×(<Ñ(<Ó=Ö>r=   )r×   ré   rt   rf   )re   r¾   )rg   rh   ri   rj   rp   r   rt   r×   ré   rî   rí   r÷   r�   r@   rI   rV   rO   r]   rc   r  r  rl   r8   r=   r:   rÍ   rÍ   8  sƒ   ‡ ð 'Ó&ØÓØ
ƒJñ " uÔ-€IˆzÓ-ñ " uÔ-€Eˆ>Ó-Ø'+€O�_Ó+õõ
6õ
&õ
(õ6õ
7÷
2÷
õCõ7õ(÷?ñ ?r=   rÍ   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   ‰  s"   € ÷  ñ  Ð$4ð  ¸Wð  Èñ  r=   c                ó&   € VP                  4        R # rÌ   )r  rá   s   &&r:   Ú_handle_acceptConnectionr  ˆ  s   € à	×ÑÖr=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   Ž  s"   € ÷ ñ Ð$4ð ¸Wð Èñ r=   c                óÔ   € \        4       pV P                   F  w  r4VP                  W44       K  	  \        R V P                  RW!P
                  4      Vn        VP                  4        R# )z1.1r¾   N)r*   ÚheadersÚaddRawHeaderr(   Ústatus_codert   ré   r  )rÝ   rÞ   ÚhdrÚkÚvs   &&   r:   Ú_handle_rejectConnectionr(  �  sP   € ä
‹)€CØ—”‰ˆØ×Ñ˜Öñ ä$ U¨E×,=Ñ,=¸rÀ3ÏÉÓX€EÔØ	×ÑÖr=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   —  s!   € ÷ )ñ )˜jð )°ð )¸Tñ )r=   c                óÖ   € VP                   f   Q R4       hVP                   P                  V P                  4       V P                  '       d   VP                  P                  4        R # R # )Nz7response should never be None when receiving RejectData)ré   Ú_bodyDataReceivedrE   Úbody_finishedrt   rO   rá   s   &&r:   Ú_handle_rejectDatar-  –  s[   € ð 	×ÑÒ)ðAà@óAØ)à	×Ñ×+Ñ+¨E¯J©JÔ7Ø××ÐØ�‰×&Ñ&Ö(ñ r=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   ¡  s!   € ÷ /ñ /˜{ð /°7ð /¸tñ /r=   c                óP   € VP                   P                  V P                  4       R # rÌ   )rç   r…   rE   rá   s   &&r:   Ú_handle_textMessager0     s   € à	‡J�J×"Ñ" 5§:¡:Ö.r=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   ¦  s!   € ÷ 0ñ 0 ð 0°Wð 0Àñ 0r=   c                óP   € VP                   P                  V P                  4       R # rÌ   )rç   r‰   rE   rá   s   &&r:   Ú_handle_bytesMessager3  ¥  s   € à	‡J�J×#Ñ# E§J¡JÖ/r=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   «  s&   € ÷ @ñ @˜ð @ Wð @°ñ @r=   c                óŠ   € VP                   P                  VP                  P                  V P	                  4       4      4       R # rÌ   )rt   rÄ   rä   rÅ   ro   rá   s   &&r:   Ú_handle_pingr6  ª  s*   € à	‡O�O×Ñ˜%Ÿ-™-×,Ñ,¨U¯^©^Ó-=Ó>Ö?r=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   °  s!   € ÷ +ñ +˜ð + Wð +°ñ +r=   c                óP   € VP                   P                  V P                  4       R # rÌ   )rç   r€   rS   rá   s   &&r:   Ú_handle_pongr9  ¯  s   € à	‡J�J×Ñ˜EŸM™MÖ*r=   c               ó$   € V ^8„  d   QhRRRRRR/# )r3   rÝ   r   rÞ   rß   r6   r7   r8   )r9   s   "r:   r;   r;   µ  s!   € ÷ %ñ % ?ð %¸7ð %Àtñ %r=   c                ó0  € VP                   f   Q hVP                  P                  \        P                  8w  dC   VP                   P                  VP                  P                  V P                  4       4      4       VP                   P                  4        R # rÌ   )	rt   rä   Ústater   ÚCLOSEDrÄ   rÅ   ro   rO   rá   s   &&r:   Ú_handle_closeConnectionr>  ´  sb   € à�?‰?Ò&Ð&Ð&Ø‡}�}×Ñœo×4Ñ4Ô4Ø�‰×Ñ˜eŸm™m×0Ñ0°·±Ó1AÓBÔCØ	‡O�O×"Ñ"Ö$r=   c               ó    € V ^8„  d   QhRRRR/# )r3   r˜   r   r6   rF   r8   )r9   s   "r:   r;   r;   ¼  s   € ÷ 3ñ 3˜wð 3¨5ñ 3r=   c                óT   € V P                  \        4       V P                  R R4       R# )zcontent-typez
text/plains$   websocket protocol negotiation error)ÚsetResponseCoder%   Ú	setHeader)r˜   s   &r:   Ú_negotiationErrorrC  ¼  s#   € Ø×ÑœKÔ(Ø×Ñ�n lÔ3Ù2r=   c                  ó>   a € ] tR tRtRtR V 3R lltR R ltRtV ;t# )Ú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               ó    € V ^8„  d   QhRRRR/# )r3   Úfactoryz)WebSocketServerFactory[WebSocketProtocol]r6   r7   r8   )r9   s   "r:   r;   ÚWebSocketResource.__annotate__È  s   € ÷ 	ñ 	Ð Ið 	Èdñ 	r=   c                ó0   <€ \         SV `  4        Wn        R# )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__rG  )r?   rG  Ú	__class__s   &&€r:   rK  ÚWebSocketResource.__init__È  s   ø€ ô 	‰ÑÔØŽr=   c               ó    € V ^8„  d   QhRRRR/# )r3   r˜   r   r6   zbytes | intr8   )r9   s   "r:   r;   rH  Ó  s   € ÷ ñ  'ð ¨kñ r=   c                óø  € \        \        P                  4      pVP                  P	                  4       pV UUUu. uF  w  rEV F  qdV3NK  	  K  	  pppp VP                  WqP                  4       T P                  P                  T4      p	T	f   Q R4       hTP                  \        4       4      p
TP                  pTP                   P"                  pTf   Q R4       hTf   Q R4       h\%        T\&        T	4      pTP                   P)                  T4       TP+                  T
4       T	P-                  4        \.        # u upppi   \         d-   p\        P                  RYR7       \        T4      u Rp?# Rp?ii ; i)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ÚerrorrC  rG  r›   rÅ   r   Ú
connectionÚchannelrt   rÍ   ÚserverBootstrapÚ_protocolUpgradeForWebsocketsrÄ   r|   r.   )r?   r˜   Ú	handshakeÚrawÚhkeyÚhvalsÚvalÚsimpleHeadersrP  ÚwsprotÚtoSendÚwsconr»   Ú	wireProtos   &&            r:   Ú
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 ÅE9Å!E4Å.E9Å4E9)rG  )	rg   rh   ri   rj   rk   rK  rf  rl   Ú__classcell__)rL  s   @r:   rE  rE  Â  s   ø† ñ÷
	ð 	÷ó r=   rE  c               ó$   € V ^8„  d   QhRRRRRR/# r¸   r8   )r9   s   "r:   r;   r;   î  s"   € ÷ ñ Ð2ð °zð Àdñ r=   c                ó   € R# )z;
The server requires no bootstrapping, so this is a no-op.
Nr8   )r¹   r»   s   &&r:   rZ  rZ  î  rB   r=   )`rk   Ú
__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.   ÚProtocolr0   Ú	Exceptionrn   rr   r’   rå   rV  r–   r    r¨   râ   rÍ   rß   Úregisterr  r(  r-  r0  r3  r6  r9  r>  rC  rE  rZ  r8   r=   r:   Ú<module>r„     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=   