+
    ‚V@iú  ã            	       óD  € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIHt ^ RIt^ RIt^ RIHtHt ^ RIHtHtHt ^ RI
HtHtHt ^ RIHt ^ RIHtHt ^ RIHtH t  ^ R	I!H"t" ^ R
I
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/H0t0H1t1H2t2H3t3H4t4H5t5 ^ RI6H7t7 ]+'       d(   ^ RI8H9t9  ! R R]94      t: ! R R]94      t; ! R R]94      t<R/t=]P|                  ! ]P~                  4      t@ ! R R]A4      tB ! R R]B4      tC ! R R]A4      tD ! R R4      tE ! R R ]
PŒ                  PŽ                  4      tHR! R" ltI ! R# R$]P”                  4      tK ! R% R&4      tL ! R' R(4      tM ! R) R*]K4      tN ! R+ R,]#Pž                  4      tPRRRRRR]=RR3	R- R. lltQR# )0aÀ  Implementation of the WebSocket protocol.

`WebSockets <http://dev.w3.org/html5/websockets/>`_ allow for bidirectional
communication between the browser and server. WebSockets are supported in the
current versions of all major browsers.

This module implements the final version of the WebSocket protocol as
defined in `RFC 6455 <http://tools.ietf.org/html/rfc6455>`_.

.. versionchanged:: 4.0
   Removed support for the draft 76 protocol version.
N)Úurlparse)ÚFutureÚ"future_set_result_unless_cancelled)Úutf8Ú
native_strÚ
to_unicode)ÚgenÚ
httpclientÚhttputil)ÚIOLoop)ÚStreamClosedErrorÚIOStream)Úgen_logÚapp_log)ÚResolver)Úsimple_httpclient)ÚQueue)Ú	TCPClient)Ú_websocket_mask)ÚTYPE_CHECKINGÚcastÚAnyÚOptionalÚDictÚUnionÚListÚ	AwaitableÚCallableÚTupleÚType)ÚTracebackType)ÚProtocolc                   óD   a € ] tR t^<t o V 3R lR ltV 3R lR ltRtV tR# )Ú_Compressorc                ó&   <€ V ^8„  d   QhRS[ RS[ /# ©é   ÚdataÚreturn©Úbytes)ÚformatÚ__classdict__s   "€Ú3/usr/lib/python3/dist-packages/tornado/websocket.pyÚ__annotate__Ú_Compressor.__annotate__=   s   ø€ ÷ 	ñ 	¡ð 	©5ñ 	ó    c                ó   € R # ©N© ©Úselfr'   s   &&r-   ÚcompressÚ_Compressor.compress=   ó   € Ùr0   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   Úmoder(   ©Úintr*   )r+   r,   s   "€r-   r.   r/   @   s   ø€ ÷ 	ñ 	™cð 	¡eñ 	r0   c                ó   € R # r2   r3   )r5   r:   s   &&r-   ÚflushÚ_Compressor.flush@   r8   r0   r3   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r6   r>   Ú__static_attributes__Ú__classdictcell__©r,   s   @r-   r#   r#   <   s   ø‡ € ÷	ð 	÷	ö 	r0   r#   c                   ó6   a € ] tR t^Ct o RtV 3R lR ltRtV tR# )Ú_Decompressorr0   c                ó,   <€ V ^8„  d   QhRS[ RS[RS[ /# )r&   r'   Ú
max_lengthr(   )r*   r<   )r+   r,   s   "€r-   r.   Ú_Decompressor.__annotate__F   s"   ø€ ÷ 	ñ 	¡5ð 	±cð 	¹eñ 	r0   c                ó   € R # r2   r3   )r5   r'   rJ   s   &&&r-   Ú
decompressÚ_Decompressor.decompressF   r8   r0   r3   N)r@   rA   rB   rC   Úunconsumed_tailrM   rD   rE   rF   s   @r-   rH   rH   C   s   ø‡ € Øˆ÷	ö 	r0   rH   c                   ó~   a € ] tR t^It o RV 3R lR lltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR ltRt	V t
R# )Ú_WebSocketDelegateNc                óJ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RR/# ©r&   Ú
close_codeÚclose_reasonr(   N©r   r<   Ústr)r+   r,   s   "€r-   r.   Ú_WebSocketDelegate.__annotate__M   s-   ø€ ÷ 	ñ 	Ù&¡s�mð	ÙBJÉ3Å-ð	àñ	r0   c                ó   € R # r2   r3   ©r5   rT   rU   s   &&&r-   Úon_ws_connection_closeÚ)_WebSocketDelegate.on_ws_connection_closeM   s   € ñ r0   c                óJ   <€ V ^8„  d   QhRS[ S[S[3,          RS[R,          /# )r&   Úmessager(   zAwaitable[None])r   rW   r*   r   )r+   r,   s   "€r-   r.   rX   R   s*   ø€ ÷ 	ñ 	¡e©C±¨JÕ&7ð 	¹HÐEVÕ<Wñ 	r0   c                ó   € R # r2   r3   ©r5   r^   s   &&r-   Ú
on_messageÚ_WebSocketDelegate.on_messageR   r8   r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r&   r'   r(   Nr)   )r+   r,   s   "€r-   r.   rX   U   ó   ø€ ÷ 	ñ 	¡ð 	¨$ñ 	r0   c                ó   € R # r2   r3   r4   s   &&r-   Úon_pingÚ_WebSocketDelegate.on_pingU   r8   r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   rX   X   re   r0   c                ó   € R # r2   r3   r4   s   &&r-   Úon_pongÚ_WebSocketDelegate.on_pongX   r8   r0   c                óp   <€ V ^8„  d   QhRS[ S[S[,          ,          RS[ S[,          RS[ S[,          RR/# )r&   ÚtypÚvalueÚtbr(   N)r   r   ÚBaseExceptionr    )r+   r,   s   "€r-   r.   rX   [   sG   ø€ ÷ 	ñ 	á™$™}Õ-Õ.ð	ñ ™MÕ*ð	ñ ™Õ'ð		ð
 ñ	r0   c                ó   € R # r2   r3   ©r5   rn   ro   rp   s   &&&&r-   Úlog_exceptionÚ _WebSocketDelegate.log_exception[   s   € ñ r0   r3   ©NN)r@   rA   rB   rC   r[   ra   rg   rk   rt   rD   rE   rF   s   @r-   rQ   rQ   I   s7   ø‡ € ÷	ò 	÷
	ð 	÷	ð 	÷	ð 	÷	ö 	r0   rQ   c                   ó   € ] tR t^jtRtR# )ÚWebSocketErrorr3   N©r@   rA   rB   rC   rD   r3   r0   r-   rx   rx   j   ó   † Ûr0   rx   c                   ó   € ] tR t^ntRtRtR# )ÚWebSocketClosedErrorzDRaised by operations on a closed connection.

.. versionadded:: 3.2
r3   N)r@   rA   rB   rC   Ú__doc__rD   r3   r0   r-   r|   r|   n   s   † ñó
 	r0   r|   c                   ó   € ] tR t^wtRtR# )Ú_DecompressTooLargeErrorr3   Nry   r3   r0   r-   r   r   w   rz   r0   r   c                   ó>   a € ] tR t^{t o RR]R3V 3R lR lltRtV tR# )Ú_WebSocketParamsNc                ó|   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RS[RS[ S[S[S[3,          ,          RR/# )r&   Úping_intervalÚping_timeoutÚmax_message_sizeÚcompression_optionsr(   N)r   Úfloatr<   r   rW   r   )r+   r,   s   "€r-   r.   Ú_WebSocketParams.__annotate__|   sR   ø€ ÷ 
7ñ 
7á¡•ð
7ñ ™u•oð
7ñ ð	
7ñ
 &¡d©3±¨8¥nÕ5ð
7ð 
ñ
7r0   c                ó6   € Wn         W n        W0n        W@n        R # r2   ©rƒ   r„   r…   r†   )r5   rƒ   r„   r…   r†   s   &&&&&r-   Ú__init__Ú_WebSocketParams.__init__|   s   € ð +ÔØ(ÔØ 0ÔØ#6Ö r0   )r†   r…   rƒ   r„   )r@   rA   rB   rC   Ú_default_max_message_sizer‹   rD   rE   rF   s   @r-   r�   r�   {   s"   ø‡ € ð *.Ø(,Ø 9Ø8<÷
7÷ 
7ð 
7r0   r�   c                   ó  a a€ ] tR t^‰t oRtV3R lV 3R lltV3R lR lt]V3R lR l4       t]V3R lR	 l4       t	]V3R
 lR l4       t
R1V3R lR lltV3R lR lt]V3R lR l4       tV3R lR ltV3R lR ltV3R lR ltR2V3R lR lltV3R lR ltV3R lR ltV3R lR ltR3V3R  lR! lltV3R" lR# ltV3R$ lR% ltV3R& lR' ltR3V3R( lR) lltV3R* lV 3R+ lltV3R, lR- ltV3R. lR/ ltR0tVtV ;t# )4ÚWebSocketHandleraZ  Subclass this class to create a basic WebSocket handler.

Override `on_message` to handle incoming messages, and use
`write_message` to send messages to the client. You can also
override `open` and `on_close` to handle opened and closed
connections.

Custom upgrade response headers can be sent by overriding
`~tornado.web.RequestHandler.set_default_headers` or
`~tornado.web.RequestHandler.prepare`.

See http://dev.w3.org/html5/websockets/ for details on the
JavaScript interface.  The protocol is specified at
http://tools.ietf.org/html/rfc6455.

Here is an example WebSocket handler that echos back all received messages
back to the client:

.. testcode::

  class EchoWebSocket(tornado.websocket.WebSocketHandler):
      def open(self):
          print("WebSocket opened")

      def on_message(self, message):
          self.write_message(u"You said: " + message)

      def on_close(self):
          print("WebSocket closed")

WebSockets are not standard HTTP connections. The "handshake" is
HTTP, but after the handshake, the protocol is
message-based. Consequently, most of the Tornado HTTP facilities
are not available in handlers of this type. The only communication
methods available to you are `write_message()`, `ping()`, and
`close()`. Likewise, your request handler class should implement
`open()` method rather than ``get()`` or ``post()``.

If you map the handler above to ``/websocket`` in your application, you can
invoke it in JavaScript with::

  var ws = new WebSocket("ws://localhost:8888/websocket");
  ws.onopen = function() {
     ws.send("Hello, world");
  };
  ws.onmessage = function (evt) {
     alert(evt.data);
  };

This script pops up an alert box that says "You said: Hello, world".

Web browsers allow any site to open a websocket connection to any other,
instead of using the same-origin policy that governs other network
access from JavaScript.  This can be surprising and is a potential
security hole, so since Tornado 4.0 `WebSocketHandler` requires
applications that wish to receive cross-origin websockets to opt in
by overriding the `~WebSocketHandler.check_origin` method (see that
method's docs for details).  Failure to do so is the most likely
cause of 403 errors when making a websocket connection.

When using a secure websocket connection (``wss://``) with a self-signed
certificate, the connection from a browser may fail because it wants
to show the "accept this certificate" dialog but has nowhere to show it.
You must first visit a regular HTML page using the same certificate
to accept it before the websocket connection will succeed.

If the application setting ``websocket_ping_interval`` has a non-zero
value, a ping will be sent periodically, and the connection will be
closed if a response is not received before the ``websocket_ping_timeout``.
Both settings are in seconds; floating point values are allowed.
The default timeout is equal to the interval.

Messages larger than the ``websocket_max_message_size`` application setting
(default 10MiB) will not be accepted.

.. versionchanged:: 4.5
   Added ``websocket_ping_interval``, ``websocket_ping_timeout``, and
   ``websocket_max_message_size``.
c                ól   <€ V ^8„  d   QhRS[ P                  P                  RS[P                  RS[RR/# )r&   ÚapplicationÚrequestÚkwargsr(   N)ÚtornadoÚwebÚApplicationr
   ÚHTTPServerRequestr   )r+   r,   s   "€r-   r.   ÚWebSocketHandler.__annotate__Ú   sC   ø€ ÷ 
&ñ 
&á—[‘[×,Ñ,ð
&ñ ×+Ñ+ð
&ñ ð	
&ð
 
ñ
&r0   c                ób   <€ \         SV `  ! W3/ VB  R V n        R V n        R V n        RV n        R # ©NF)Úsuperr‹   Úws_connectionrT   rU   Ú_on_close_called)r5   r‘   r’   r“   Ú	__class__s   &&&,€r-   r‹   ÚWebSocketHandler.__init__Ú   s6   ø€ ô 	‰Ò˜Ñ8°Ò8Ø!ˆÔØˆŒØ ˆÔØ %ˆÖr0   c                ó*   <€ V ^8„  d   QhRS[ RS[ RR/# ©r&   Úargsr“   r(   N©r   )r+   r,   s   "€r-   r.   r˜   æ   s'   ø€ ÷ 2Añ 2A™sð 2A©cð 2A°dñ 2Ar0   c              �  óz  "  € Wn         W n        V P                  P                  P	                  R R4      P                  4       R8w  d=   V P                  R4       RpV P                  V4       \        P                  ! V4       R# V P                  P                  p\        R VP	                  RR4      P                  R4      4      pR	V9  d=   V P                  R4       R
pV P                  V4       \        P                  ! V4       R# RV P                  P                  9   d'   V P                  P                  P	                  R4      pM&V P                  P                  P	                  RR4      pVeT   V P                  V4      '       g=   V P                  R4       RpV P                  V4       \        P                  ! V4       R# V P                  4       V n        V P                  '       d&   V P                  P                  V 4      G Rj  x€L
  R# V P                  RR4       V P!                  RR4       R#  L,5i)ÚUpgradeÚ Ú	websocketé�  z"Can "Upgrade" only to "WebSocket".Nc                 ó>   € V P                  4       P                  4       # r2   )ÚstripÚlower)Úss   &r-   Ú<lambda>Ú&WebSocketHandler.get.<locals>.<lambda>÷   s   € �a—g‘g“i—o‘oÔ'r0   Ú
ConnectionÚ,Úupgradez"Connection" must be "Upgrade".ÚOriginzSec-Websocket-Origini“  z#Cross origin websockets not allowediª  zUpgrade RequiredúSec-WebSocket-Versionz7, 8, 13)Ú	open_argsÚopen_kwargsr’   ÚheadersÚgetr«   Ú
set_statusÚfinishr   ÚdebugÚmapÚsplitÚcheck_originÚget_websocket_protocolrœ   Úaccept_connectionÚ
set_header)r5   r¢   r“   Úlog_msgr¶   Ú
connectionÚorigins   &*,    r-   r·   ÚWebSocketHandler.getæ   s»  é € ØŒØ!Ôð �<‰<×Ñ×#Ñ# I¨rÓ2×8Ñ8Ó:¸kÔIØ�O‰O˜CÔ Ø:ˆGØ�K‰K˜Ô Ü�MŠM˜'Ô"Ùð
 —,‘,×&Ñ&ˆÜÙ'¨¯©°\À2Ó)F×)LÑ)LÈSÓ)Qó
ˆ
ð ˜JÔ&Ø�O‰O˜CÔ Ø7ˆGØ�K‰K˜Ô Ü�MŠM˜'Ô"Ùð �t—|‘|×+Ñ+Ô+Ø—\‘\×)Ñ)×-Ñ-¨hÓ7‰Fà—\‘\×)Ñ)×-Ñ-Ð.DÀdÓKˆFð
 Ò d×&7Ñ&7¸×&?Ò&?Ø�O‰O˜CÔ Ø;ˆGØ�K‰K˜Ô Ü�MŠM˜'Ô"Ùà!×8Ñ8Ó:ˆÔØ××ÐØ×$Ñ$×6Ñ6°tÓ<×<Ò<à�O‰O˜CÐ!3Ô4Ø�O‰OÐ3°ZÖ@ñ =ùs   ‚FH;ÆA"H;Ç.H;ÈH9È-H;c                ó0   <€ V ^8„  d   QhRS[ S[,          /# ©r&   r(   ©r   r‡   )r+   r,   s   "€r-   r.   r˜     s   ø€ ÷ Bñ B™x©�ñ Br0   c                ó:   € V P                   P                  RR4      # )aN  The interval for sending websocket pings.

If this is non-zero, the websocket will send a ping every
ping_interval seconds.
The client will respond with a "pong". The connection can be configured
to timeout on late pong delivery using ``websocket_ping_timeout``.

Set ``websocket_ping_interval = 0`` to disable pings.

Default: ``0``
Úwebsocket_ping_intervalN©Úsettingsr·   ©r5   s   &r-   rƒ   ÚWebSocketHandler.ping_interval  s   € ð �}‰}× Ñ Ð!:¸DÓAÐAr0   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rÆ   rÇ   )r+   r,   s   "€r-   r.   r˜   *  s   ø€ ÷ Añ A™h¡u�oñ Ar0   c                ó:   € V P                   P                  RR4      # )a½  Timeout if no pong is received in this many seconds.

To be used in combination with ``websocket_ping_interval > 0``.
If a ping response (a "pong") is not received within
``websocket_ping_timeout`` seconds, then the websocket connection
will be closed.

This can help to clean up clients which have disconnected without
cleanly closing the websocket connection.

Note, the ping timeout cannot be longer than the ping interval.

Set ``websocket_ping_timeout = 0`` to disable the ping timeout.

Default: equal to the ``ping_interval``.

.. versionchanged:: 6.5.0
   Default changed from the max of 3 pings or 30 seconds.
   The ping timeout can no longer be configured longer than the
   ping interval.
Úwebsocket_ping_timeoutNrÊ   rÌ   s   &r-   r„   ÚWebSocketHandler.ping_timeout)  s   € ð. �}‰}× Ñ Ð!9¸4Ó@Ð@r0   c                ó    <€ V ^8„  d   QhRS[ /# rÆ   )r<   )r+   r,   s   "€r-   r.   r˜   C  s   ø€ ÷ 

ñ 

¡#ñ 

r0   c                óB   € V P                   P                  R\        4      # )z†Maximum allowed message size.

If the remote peer sends a message larger than this, the connection
will be closed.

Default is 10MiB.
Úwebsocket_max_message_size)rË   r·   r�   rÌ   s   &r-   r…   Ú!WebSocketHandler.max_message_sizeB  s!   € ð �}‰}× Ñ Ø(Ô*Có
ð 	
r0   c                óZ   <€ V ^8„  d   QhRS[ S[S[S[S[S[3,          3,          RS[RR/# ©r&   r^   Úbinaryr(   úFuture[None])r   r*   rW   r   r   Úbool)r+   r,   s   "€r-   r.   r˜   O  s>   ø€ ÷ Hñ HÙ™U¡C©©c±3¨h­Ð7Õ8ðHÙBFðHà	ñHr0   c                ó  € V P                   e!   V P                   P                  4       '       d   \        4       h\        V\        4      '       d    \
        P                  P                  V4      pV P                   P                  WR7      # )aÐ  Sends the given message to the client of this Web Socket.

The message may be either a string or a dict (which will be
encoded as json).  If the ``binary`` argument is false, the
message will be sent as utf8; in binary mode any byte string
is allowed.

If the connection is already closed, raises `WebSocketClosedError`.
Returns a `.Future` which can be used for flow control.

.. versionchanged:: 3.2
   `WebSocketClosedError` was added (previously a closed connection
   would raise an `AttributeError`)

.. versionchanged:: 4.3
   Returns a `.Future` which can be used for flow control.

.. versionchanged:: 5.0
   Consistently raises `WebSocketClosedError`. Previously could
   sometimes raise `.StreamClosedError`.
©rØ   )	rœ   Ú
is_closingr|   Ú
isinstanceÚdictr”   ÚescapeÚjson_encodeÚwrite_message©r5   r^   rØ   s   &&&r-   râ   ÚWebSocketHandler.write_messageO  sh   € ð0 ×ÑÒ%¨×);Ñ);×)FÑ)F×)HÒ)HÜ&Ó(Ð(Ü�gœt×$Ò$Ü—n‘n×0Ñ0°Ó9ˆGØ×!Ñ!×/Ñ/°Ð/ÓGÐGr0   c                óF   <€ V ^8„  d   QhRS[ S[,          RS[S[,          /# )r&   Úsubprotocolsr(   )r   rW   r   )r+   r,   s   "€r-   r.   r˜   m  s#   ø€ ÷ ñ ©t±C­yð ¹XÁc½]ñ r0   c                ó   € R# )a(  Override to implement subprotocol negotiation.

``subprotocols`` is a list of strings identifying the
subprotocols proposed by the client.  This method may be
overridden to return one of those strings to select it, or
``None`` to not select a subprotocol.

Failure to select a subprotocol does not automatically abort
the connection, although clients may close the connection if
none of their proposed subprotocols was selected.

The list may be empty, in which case this method must return
None. This method is always called exactly once even if no
subprotocols were proposed so that the handler can be advised
of this fact.

.. versionchanged:: 5.1

   Previously, this method was called with a list containing
   an empty string instead of an empty list if no subprotocols
   were proposed by the client.
Nr3   )r5   ræ   s   &&r-   Úselect_subprotocolÚ#WebSocketHandler.select_subprotocolm  s   € ñ. r0   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rÆ   ©r   rW   )r+   r,   s   "€r-   r.   r˜   ‡  s   ø€ ÷ 7ñ 7¡h©s¥mñ 7r0   c                óN   € V P                   f   Q hV P                   P                  # )zIThe subprotocol returned by `select_subprotocol`.

.. versionadded:: 5.1
)rœ   Úselected_subprotocolrÌ   s   &r-   rí   Ú%WebSocketHandler.selected_subprotocol†  s(   € ð ×!Ñ!Ò-Ð-Ð-Ø×!Ñ!×6Ñ6Ð6r0   c                óF   <€ V ^8„  d   QhRS[ S[S[S[3,          ,          /# rÆ   )r   r   rW   r   )r+   r,   s   "€r-   r.   r˜   �  s!   ø€ ÷ ñ ©±$±s¹C°xµ.Õ)Añ r0   c                ó   € R# )a}  Override to return compression options for the connection.

If this method returns None (the default), compression will
be disabled.  If it returns a dict (even an empty one), it
will be enabled.  The contents of the dict may be used to
control the following compression options:

``compression_level`` specifies the compression level.

``mem_level`` specifies the amount of memory used for the internal compression state.

 These parameters are documented in detail here:
 https://docs.python.org/3.13/library/zlib.html#zlib.compressobj

.. versionadded:: 4.1

.. versionchanged:: 4.5

   Added ``compression_level`` and ``mem_level``.
Nr3   rÌ   s   &r-   Úget_compression_optionsÚ(WebSocketHandler.get_compression_options�  s   € ñ, r0   c                óJ   <€ V ^8„  d   QhRS[ RS[ RS[S[R,          ,          /# r¡   )rW   r   r   )r+   r,   s   "€r-   r.   r˜   §  s+   ø€ ÷ ñ ™#ð ©ð ±¹)ÀD½/Õ1Jñ r0   c                ó   € R# )aP  Invoked when a new WebSocket is opened.

The arguments to `open` are extracted from the `tornado.web.URLSpec`
regular expression, just like the arguments to
`tornado.web.RequestHandler.get`.

`open` may be a coroutine. `on_message` will not be called until
`open` has returned.

.. versionchanged:: 5.1

   ``open`` may be a coroutine.
Nr3   )r5   r¢   r“   s   &*,r-   ÚopenÚWebSocketHandler.open§  s   € ñ 	r0   c                óZ   <€ V ^8„  d   QhRS[ S[S[3,          RS[S[R,          ,          /# ©r&   r^   r(   N©r   rW   r*   r   r   )r+   r,   s   "€r-   r.   r˜   ·  s-   ø€ ÷ 	"ñ 	"¡%©©U¨
Õ"3ð 	"¹ÁÈ4ÅÕ8Qñ 	"r0   c                ó   € \         h)z‹Handle incoming messages on the WebSocket

This method must be overridden.

.. versionchanged:: 4.5

   ``on_message`` can be a coroutine.
©ÚNotImplementedErrorr`   s   &&r-   ra   ÚWebSocketHandler.on_message·  s
   € ô "Ð!r0   c                ó:   <€ V ^8„  d   QhRS[ S[S[3,          RR/# rd   ©r   rW   r*   )r+   r,   s   "€r-   r.   r˜   Â  s$   ø€ ÷ ,ñ ,™™s¡E˜zÕ*ð ,°Tñ ,r0   c                óÂ   € \        V4      pV P                  e!   V P                  P                  4       '       d   \        4       hV P                  P	                  V4       R# )a†  Send ping frame to the remote end.

The data argument allows a small amount of data (up to 125
bytes) to be sent as a part of the ping message. Note that not
all websocket implementations expose this data to
applications.

Consider using the ``websocket_ping_interval`` application
setting instead of sending pings manually.

.. versionchanged:: 5.1

   The data argument is now optional.

N)r   rœ   rÝ   r|   Ú
write_pingr4   s   &&r-   ÚpingÚWebSocketHandler.pingÂ  sJ   € ô  �D‹zˆØ×ÑÒ%¨×);Ñ);×)FÑ)F×)HÒ)HÜ&Ó(Ð(Ø×Ñ×%Ñ% dÖ+r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   r˜   ×  ó   ø€ ÷ ñ ™Eð  dñ r0   c                ó   € R# )z6Invoked when the response to a ping frame is received.Nr3   r4   s   &&r-   rk   ÚWebSocketHandler.on_pong×  ó   € ár0   c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   r˜   Û  r  r0   c                ó   € R# )z*Invoked when the a ping frame is received.Nr3   r4   s   &&r-   rg   ÚWebSocketHandler.on_pingÛ  r  r0   c                ó   <€ V ^8„  d   QhRR/# ©r&   r(   Nr3   )r+   r,   s   "€r-   r.   r˜   ß  s   ø€ ÷ ñ ˜$ñ r0   c                ó   € R# )a0  Invoked when the WebSocket is closed.

If the connection was closed cleanly and a status code or reason
phrase was supplied, these values will be available as the attributes
``self.close_code`` and ``self.close_reason``.

.. versionchanged:: 4.0

   Added ``close_code`` and ``close_reason`` attributes.
Nr3   rÌ   s   &r-   Úon_closeÚWebSocketHandler.on_closeß  s   € ñ 	r0   c                óJ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RR/# ©r&   ÚcodeÚreasonr(   NrV   )r+   r,   s   "€r-   r.   r˜   ì  s+   ø€ ÷ &ñ &™(¡3�-ð &¹Á½ð &ÐQUñ &r0   c                ór   € V P                   '       d%   V P                   P                  W4       RV n         R# R# )aó  Closes this Web Socket.

Once the close handshake is successful the socket will be closed.

``code`` may be a numeric status code, taken from the values
defined in `RFC 6455 section 7.4.1
<https://tools.ietf.org/html/rfc6455#section-7.4.1>`_.
``reason`` may be a textual message about why the connection is
closing.  These values are made available to the client, but are
not otherwise interpreted by the websocket protocol.

.. versionchanged:: 4.0

   Added the ``code`` and ``reason`` arguments.
N)rœ   Úclose©r5   r  r  s   &&&r-   r  ÚWebSocketHandler.closeì  s1   € ð  ××ÐØ×Ñ×$Ñ$ TÔ2Ø!%ˆDÖñ r0   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   rÃ   r(   )rW   rÚ   )r+   r,   s   "€r-   r.   r˜      s   ø€ ÷ 6ñ 6¡3ð 6©4ñ 6r0   c                ó¢   € \        V4      pVP                  pVP                  4       pV P                  P                  P                  R4      pW8H  # )a·  Override to enable support for allowing alternate origins.

The ``origin`` argument is the value of the ``Origin`` HTTP
header, the url responsible for initiating this request.  This
method is not called for clients that do not send this header;
such requests are always allowed (because all browsers that
implement WebSockets support this header, and non-browser
clients do not have the same cross-site security concerns).

Should return ``True`` to accept the request or ``False`` to
reject it. By default, rejects all requests with an origin on
a host other than this one.

This is a security protection against cross site scripting attacks on
browsers, since WebSockets are allowed to bypass the usual same-origin
policies and don't use CORS headers.

.. warning::

   This is an important security measure; don't disable it
   without understanding the security implications. In
   particular, if your authentication is cookie-based, you
   must either restrict the origins allowed by
   ``check_origin()`` or implement your own XSRF-like
   protection for websocket connections. See `these
   <https://www.christian-schneider.net/CrossSiteWebSocketHijacking.html>`_
   `articles
   <https://devcenter.heroku.com/articles/websocket-security>`_
   for more.

To accept all cross-origin traffic (which was the default prior to
Tornado 4.0), simply override this method to always return ``True``::

    def check_origin(self, origin):
        return True

To allow connections from any subdomain of your site, you might
do something like::

    def check_origin(self, origin):
        parsed_origin = urllib.parse.urlparse(origin)
        return parsed_origin.netloc.endswith(".mydomain.com")

.. versionadded:: 4.0

ÚHost)r   Únetlocr«   r’   r¶   r·   )r5   rÃ   Úparsed_originÚhosts   &&  r-   r½   ÚWebSocketHandler.check_origin   sI   € ô^ ! Ó(ˆØ×%Ñ%ˆØ—‘“ˆà�|‰|×#Ñ#×'Ñ'¨Ó/ˆð ‰~Ðr0   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r&   ro   r(   N©rÚ   )r+   r,   s   "€r-   r.   r˜   8  s   ø€ ÷ .ñ .¡ð .¨$ñ .r0   c                ó\   € V P                   f   Q hV P                   P                  V4       R# )aé  Set the no-delay flag for this stream.

By default, small messages may be delayed and/or combined to minimize
the number of packets sent.  This can sometimes cause 200-500ms delays
due to the interaction between Nagle's algorithm and TCP delayed
ACKs.  To reduce this delay (at the expense of possibly increasing
bandwidth usage), call ``self.set_nodelay(True)`` once the websocket
connection is established.

See `.BaseIOStream.set_nodelay` for additional details.

.. versionadded:: 3.1
N)rœ   Úset_nodelay©r5   ro   s   &&r-   r$  ÚWebSocketHandler.set_nodelay8  s*   € ð ×!Ñ!Ò-Ð-Ð-Ø×Ñ×&Ñ& uÖ-r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   r˜   I  s   ø€ ÷ !ñ ! Tñ !r0   c                óâ   € V P                   '       d"   V P                   P                  4        R V n         V P                  '       g*   RV n        V P                  4        V P	                  4        R # R # )NT)rœ   Úon_connection_closer�   r  Ú_break_cyclesrÌ   s   &r-   r)  Ú$WebSocketHandler.on_connection_closeI  sV   € Ø××ÐØ×Ñ×2Ñ2Ô4Ø!%ˆDÔØ×$×$Ð$Ø$(ˆDÔ!Ø�M‰MŒOØ×ÑÖ ñ %r0   c                óJ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RR/# rS   rV   )r+   r,   s   "€r-   r.   r˜   R  ó-   ø€ ÷ #ñ #Ù"¡3�-ð#Ù>FÁs½mð#à	ñ#r0   c                ó>   € Wn         W n        V P                  4        R # r2   ©rT   rU   r)  rZ   s   &&&r-   r[   Ú'WebSocketHandler.on_ws_connection_closeR  ó   € ð %ŒØ(ÔØ× Ñ Ö"r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   r˜   Y  s   ø€ ÷ $ñ $˜tñ $r0   c                óv   <€ V P                  4       ^e8w  g   V P                  '       d   \        SV `  4        R# R# ©ée   N)Ú
get_statusr�   r›   r*  ©r5   rž   s   &€r-   r*  ÚWebSocketHandler._break_cyclesY  s/   ø€ ð �?‰?Ó Ô# t×'<×'<Ð'<Ü‰GÑ!Ö#ñ (=r0   c                ó.   <€ V ^8„  d   QhRS[ R,          /# )r&   r(   ÚWebSocketProtocol)r   )r+   r,   s   "€r-   r.   r˜   b  s   ø€ ÷ 
ñ 
©Ð1DÕ(Eñ 
r0   c                óî   € V P                   P                  P                  R 4      pVR9   dI   \        V P                  V P
                  V P                  V P                  4       R7      p\        V RV4      # R# )r³   rŠ   FN)Ú7Ú8Ú13)	r’   r¶   r·   r�   rƒ   r„   r…   rñ   ÚWebSocketProtocol13)r5   Úwebsocket_versionÚparamss   &  r-   r¾   Ú'WebSocketHandler.get_websocket_protocolb  sl   € Ø ŸL™L×0Ñ0×4Ñ4Ð5LÓMÐØÐ 0Ô0Ü%Ø"×0Ñ0Ø!×.Ñ.Ø!%×!6Ñ!6Ø$(×$@Ñ$@Ó$Bô	ˆFô ' t¨U°FÓ;Ð;Ùr0   c                ó    <€ V ^8„  d   QhRS[ /# rÆ   )r   )r+   r,   s   "€r-   r.   r˜   n  s   ø€ ÷ ñ ¡ñ r0   c                óT   € R F  p\        W\        4       K  	  V P                  4       # )Úwrite)rE  ÚredirectrÀ   Ú
set_cookier¸   r>   r¹   )ÚsetattrÚ#_raise_not_supported_for_websocketsÚdetach)r5   Úmethods   & r-   Ú_detach_streamÚWebSocketHandler._detach_streamn  s)   € ó
ˆFô �DÔ"EÖFñ
ð �{‰{‹}Ðr0   )r�   rT   rU   r´   rµ   rœ   ©F©r0   rv   ) r@   rA   rB   rC   r}   r‹   r·   Úpropertyrƒ   r„   r…   râ   rè   rí   rñ   rõ   ra   r  rk   rg   r  r  r½   r$  r)  r[   r*  r¾   rL  rD   rE   Ú__classcell__©rž   r,   s   @@r-   r�   r�   ‰   s)  ù‡ € ñN÷`
&ó 
&÷2Að 2Aðh ÷Bó ðBð ÷Aó ðAð0 ÷

ó ð

÷Hò H÷<ð ð2 ÷7ó ð7÷ð ÷0ð ÷ 	"ð 	"÷,ò ,÷*ð ÷ð ÷ð ÷&ò &÷(6ð 6÷p.ð .÷"!ð !÷#ò #÷$ó $÷
ð 
÷÷ ð r0   r�   c                ó4   € V ^8„  d   QhR\         R\         RR/# r¡   r£   )r+   s   "r-   r.   r.   }  s!   € ÷ ?ñ ?¬sð ?¼cð ?Àdñ ?r0   c                  ó   € \        R 4      h)z$Method not supported for Web Sockets)ÚRuntimeError)r¢   r“   s   *,r-   rI  rI  }  s   € Ü
Ð=Ó
>Ð>r0   c                   ó^  a € ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 lt]	P                  R!V 3R lR ll4       t]	P                  V 3R lR l4       t]	P                  V 3R lR l4       t]	P                  R"V 3R lR ll4       t]]	P                  V 3R lR l4       4       t]	P                  V 3R lR l4       t]	P                  V 3R lR l4       t]	P                  V 3R lR l4       t]	P                  V 3R lR l4       t]	P                  V 3R lR l4       tR tV tR# )#r:  i�  z+Base class for WebSocket protocol versions.c                ó"   <€ V ^8„  d   QhRRRR/# )r&   ÚhandlerrQ   r(   Nr3   )r+   r,   s   "€r-   r.   ÚWebSocketProtocol.__annotate__„  s   ø€ ÷ 'ñ 'Ð 4ð '¸ñ 'r0   c                ó<   € Wn         R V n        RV n        RV n        R # rš   )rX  ÚstreamÚclient_terminatedÚserver_terminated©r5   rX  s   &&r-   r‹   ÚWebSocketProtocol.__init__„  s   € ØŒØˆŒØ!&ˆÔØ!&ˆÖr0   c                ó0   <€ V ^8„  d   QhRS[ RS[RS[RR/# )r&   Úcallbackr¢   r“   r(   zOptional[Future[Any]])r   r   )r+   r,   s   "€r-   r.   rY  Š  s-   ø€ ÷ ñ Ù ðÙ),ðÙ8;ðà	 ñr0   c                óX  €  V! V/ VB pVeN   \         P                  ! V4      pV P                  f   Q hV P                  P                  P	                  VR 4       V#   \
         dB    T P                  P                  ! \        P                  ! 4       !   T P                  4         R# i ; i)z¢Runs the given callback with exception handling.

If the callback is a coroutine, returns its Future. On error, aborts the
websocket connection and returns None.
Nc                 ó"   € V P                  4       # r2   )Úresult)Úfs   &r-   r­   Ú1WebSocketProtocol._run_callback.<locals>.<lambda>œ  s
   € ÀÇÁÄr0   )r   Úconvert_yieldedr[  Úio_loopÚ
add_futureÚ	ExceptionrX  rt   ÚsysÚexc_infoÚ_abort)r5   ra  r¢   r“   rd  s   &&*, r-   Ú_run_callbackÚWebSocketProtocol._run_callbackŠ  s“   € ð	Ù˜tÐ. vÑ.ˆFð Ò!Ü×,Ò,¨VÓ4�Ø—{‘{Ò.Ð.Ð.Ø—‘×#Ñ#×.Ñ.¨vÑ7KÔLØˆMøô ô 	Ø�L‰L×&Ò&¬¯ª«Ò7Ø�K‰KŒMÚð	ús   ‚A ÁAB)Â(B)c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rY  Ÿ  s   ø€ ÷ ñ  Tñ r0   c                ó&   € V P                  4        R # r2   )rm  rÌ   s   &r-   r)  Ú%WebSocketProtocol.on_connection_closeŸ  s   € Ø�‰Žr0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rY  ¢  s   ø€ ÷ ñ ˜ñ r0   c                ó’   € RV n         RV n        V P                  e   V P                  P                  4        V P                  4        R# )z?Instantly aborts the WebSocket connection by closing the socketTN)r\  r]  r[  r  rÌ   s   &r-   rm  ÚWebSocketProtocol._abort¢  s5   € à!%ˆÔØ!%ˆÔØ�;‰;Ò"Ø�K‰K×ÑÔØ�
‰
Žr0   Nc                óJ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RR/# r  rV   )r+   r,   s   "€r-   r.   rY  «  s+   ø€ ÷ $ñ $™(¡3�-ð $¹Á½ð $ÐQUñ $r0   c                ó   € \        4       hr2   rû   r  s   &&&r-   r  ÚWebSocketProtocol.closeª  ó   € ä!Ó#Ð#r0   c                ó    <€ V ^8„  d   QhRS[ /# rÆ   r"  )r+   r,   s   "€r-   r.   rY  ¯  s   ø€ ÷ $ñ $™Dñ $r0   c                ó   € \        4       hr2   rû   rÌ   s   &r-   rÝ   ÚWebSocketProtocol.is_closing®  ry  r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r&   rX  r(   N©r�   )r+   r,   s   "€r-   r.   rY  ³  s   ø€ ÷ $ñ $Ñ/?ð $ÀDñ $r0   c              ƒ  ó   "  € \        4       h5ir2   rû   r^  s   &&r-   r¿   Ú#WebSocketProtocol.accept_connection²  ó   é € ä!Ó#Ð#ùó   ‚c                óZ   <€ V ^8„  d   QhRS[ S[S[S[S[S[3,          3,          RS[RR/# r×   ©r   rW   r*   r   r   rÚ   )r+   r,   s   "€r-   r.   rY  ·  s9   ø€ ÷ $ñ $Ù™S¡%©©c±3¨h­Ð7Õ8ð$ÙBFð$à	ñ$r0   c                ó   € \        4       hr2   rû   rã   s   &&&r-   râ   ÚWebSocketProtocol.write_message¶  ó   € ô "Ó#Ð#r0   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rÆ   rë   )r+   r,   s   "€r-   r.   rY  ¾  s   ø€ ÷ $ñ $¡h©s¥mñ $r0   c                ó   € \        4       hr2   rû   rÌ   s   &r-   rí   Ú&WebSocketProtocol.selected_subprotocol¼  s   € ô "Ó#Ð#r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   rY  Â  s   ø€ ÷ $ñ $™uð $¨ñ $r0   c                ó   € \        4       hr2   rû   r4   s   &&r-   r  ÚWebSocketProtocol.write_pingÁ  ry  r0   c                óT   <€ V ^8„  d   QhRS[ S[S[3,          RS[P                  RR/# ©r&   Úkeyr¶   r(   N©r   rW   r*   r
   ÚHTTPHeaders)r+   r,   s   "€r-   r.   rY  Ê  s4   ø€ ÷ $ñ $Ù™™e˜Õ$ð$Ù/7×/CÑ/Cð$à	ñ$r0   c                ó   € \        4       hr2   rû   )r5   r‘  r¶   s   &&&r-   Ú_process_server_headersÚ)WebSocketProtocol._process_server_headersÉ  rˆ  r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rY  Ð  s   ø€ ÷ $ñ $˜tñ $r0   c                ó   € \        4       hr2   rû   rÌ   s   &r-   Ústart_pingingÚWebSocketProtocol.start_pingingÏ  ry  r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rY  Ô  s   ø€ ÷ $ñ $¨4ñ $r0   c              ƒ  ó   "  € \        4       h5ir2   rû   rÌ   s   &r-   Ú_receive_frame_loopÚ%WebSocketProtocol._receive_frame_loopÓ  r‚  rƒ  c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r&   Úxr(   Nr"  )r+   r,   s   "€r-   r.   rY  Ø  s   ø€ ÷ $ñ $™Tð $ dñ $r0   c                ó   € \        4       hr2   rû   ©r5   r¡  s   &&r-   r$  ÚWebSocketProtocol.set_nodelay×  ry  r0   )r\  rX  r]  r[  rv   rN  )r@   rA   rB   rC   r}   r‹   rn  r)  rm  ÚabcÚabstractmethodr  rÝ   r¿   râ   rP  rí   r  r•  r™  r�  r$  rD   rE   rF   s   @r-   r:  r:  �  sF  ø‡ € Ù5÷'ð '÷ð ÷*ð ÷ð ð 	×Ñ÷$ñ $ó ð$ð 	×Ñ÷$ó ð$ð 	×Ñ÷$ó ð$ð 	×Ñ÷$ñ $ó ð$ð
 Ø×Ñ÷$ó ó ð$ð 	×Ñ÷$ó ð$ð 	×Ñ÷$ó ð$ð
 	×Ñ÷$ó ð$ð 	×Ñ÷$ó ð$ð 	×Ñ÷$ó ö$r0   r:  c                   óZ   a € ] tR tRt o R
V 3R lR lltV 3R lR ltV 3R lR ltR	tV tR# )Ú_PerMessageDeflateCompressoriÜ  Nc          	      óf   <€ V ^8„  d   QhRS[ RS[S[,          RS[S[S[S[3,          ,          RR/# )r&   Ú
persistentÚ	max_wbitsr†   r(   N©rÚ   r   r<   r   rW   r   )r+   r,   s   "€r-   r.   Ú)_PerMessageDeflateCompressor.__annotate__Ý  sD   ø€ ÷ !$ñ !$áð!$ñ ™C•=ð!$ñ &¡d©3±¨8¥nÕ5ð	!$ð
 
ñ!$r0   c                óÂ  € Vf   \         P                  p^Tu;8:  d   \         P                  8:  g   M \        RV\         P                  4      hW n        Ve   RV9  d+   \        P
                  P                  P                  V n        MVR,          V n        Ve   RV9  d	   ^V n	        MVR,          V n	        V'       d   V P                  4       V n        R # R V n        R # )Nú.Invalid max_wbits value %r; allowed range 8-%dÚcompression_levelÚ	mem_level)ÚzlibÚ	MAX_WBITSÚ
ValueErrorÚ
_max_wbitsr”   r•   ÚGZipContentEncodingÚ
GZIP_LEVELÚ_compression_levelÚ
_mem_levelÚ_create_compressorÚ_compressor)r5   rª  r«  r†   s   &&&&r-   r‹   Ú%_PerMessageDeflateCompressor.__init__Ý  s¹   € ð ÒÜŸ™ˆIà�YÖ0¤$§.¡.Ö0ÜØ@ØÜ—‘óð ð
 $Œð  Ò'Ø"Ð*=Ô=ä&-§k¡k×&EÑ&E×&PÑ&PˆDÕ#à&9Ð:MÕ&NˆDÔ#àÒ&¨+Ð=PÔ*PØˆD�Oà1°+Õ>ˆDŒOçØ#×6Ñ6Ó8ˆDÖà#ˆDÖr0   c                ó   <€ V ^8„  d   QhRR/# )r&   r(   r#   r3   )r+   r,   s   "€r-   r.   r­     s   ø€ ÷ 
ñ 
 Mñ 
r0   c                óŽ   € \         P                  ! V P                  \         P                  V P                  ) V P
                  4      # r2   )r²  Úcompressobjr¸  ÚDEFLATEDrµ  r¹  rÌ   s   &r-   rº  Ú/_PerMessageDeflateCompressor._create_compressor   s3   € Ü×ÒØ×#Ñ#¤T§]¡]°T·_±_Ð4DÀdÇoÁoó
ð 	
r0   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r%   r)   )r+   r,   s   "€r-   r.   r­    s   ø€ ÷ ñ ™Uð ¡uñ r0   c                óð   € V P                   ;'       g    V P                  4       pVP                  V4      VP                  \        P
                  4      ,           pVP                  R 4      '       g   Q hVRR # )ó     ÿÿNéüÿÿÿ)r»  rº  r6   r>   r²  ÚZ_SYNC_FLUSHÚendswith)r5   r'   Ú
compressors   && r-   r6   Ú%_PerMessageDeflateCompressor.compress  sf   € Ø×%Ñ%×BÐB¨×)@Ñ)@Ó)Bˆ
Ø×"Ñ" 4Ó(¨:×+;Ñ+;¼D×<MÑ<MÓ+NÕNˆØ�}‰}Ð0×1Ò1Ð1Ð1Ø�C�RˆyÐr0   )r¸  r»  rµ  r¹  r2   )	r@   rA   rB   rC   r‹   rº  r6   rD   rE   rF   s   @r-   r¨  r¨  Ü  s$   ø‡ € ÷!$ò !$÷F
ð 
÷
ö r0   r¨  c                   óZ   a € ] tR tRt o R
V 3R lR lltV 3R lR ltV 3R lR ltR	tV tR# )Ú_PerMessageDeflateDecompressori  Nc                ól   <€ V ^8„  d   QhRS[ RS[S[,          RS[RS[S[S[S[3,          ,          RR/# )r&   rª  r«  r…   r†   r(   Nr¬  )r+   r,   s   "€r-   r.   Ú+_PerMessageDeflateDecompressor.__annotate__  sN   ø€ ÷ &ñ &áð&ñ ™C•=ð&ñ ð	&ñ
 &¡d©3±¨8¥nÕ5ð&ð 
ñ&r0   c                ó  € W0n         Vf   \        P                  p^Tu;8:  d   \        P                  8:  g   M \        RV\        P                  4      hW n        V'       d   V P                  4       V n        R # R V n        R # )Nr¯  )Ú_max_message_sizer²  r³  r´  rµ  Ú_create_decompressorÚ_decompressor)r5   rª  r«  r…   r†   s   &&&&&r-   r‹   Ú'_PerMessageDeflateDecompressor.__init__  sl   € ð "2ÔØÒÜŸ™ˆIØ�YÖ0¤$§.¡.Ö0ÜØ@ØÜ—‘óð ð
 $Œßà×)Ñ)Ó+ð Öð "&ˆDÖr0   c                ó   <€ V ^8„  d   QhRR/# )r&   r(   rH   r3   )r+   r,   s   "€r-   r.   rÍ  %  s   ø€ ÷ 4ñ 4 oñ 4r0   c                óD   € \         P                  ! V P                  ) 4      # r2   )r²  Údecompressobjrµ  rÌ   s   &r-   rÐ  Ú3_PerMessageDeflateDecompressor._create_decompressor%  s   € Ü×!Ò! 4§?¡?Ð"2Ó3Ð3r0   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# r%   r)   )r+   r,   s   "€r-   r.   rÍ  (  s   ø€ ÷ ñ ™uð ©ñ r0   c                óÌ   € V P                   ;'       g    V P                  4       pVP                  VR ,           V P                  4      pVP                  '       d   \        4       hV# )rÄ  )rÑ  rÐ  rM   rÏ  rO   r   )r5   r'   Údecompressorrd  s   &&  r-   rM   Ú)_PerMessageDeflateDecompressor.decompress(  s[   € Ø×)Ñ)×HÐH¨T×-FÑ-FÓ-HˆØ×(Ñ(ØÐ&Õ&¨×(>Ñ(>ó
ˆð ×'×'Ð'Ü*Ó,Ð,Øˆr0   )rÑ  rÏ  rµ  r2   )	r@   rA   rB   rC   r‹   rÐ  rM   rD   rE   rF   s   @r-   rË  rË    s#   ø‡ € ÷&ò &÷04ð 4÷ö r0   rË  c                   ó¦  a € ] tR tRt o Rt^€t^@t^ t^t]],          ],          t	^t
RtV 3R lR lt]V 3R lR l4       t]P                  V 3R lR	 l4       tV 3R
 lR ltV 3R lR lt]V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR;V 3R lR lltR;V 3R lR lltR<V 3R lR lltR=V 3R lR lltV 3R  lR! ltV 3R" lR# ltV 3R$ lR% ltV 3R& lR' ltV 3R( lR) lt R>V 3R* lR+ llt!V 3R, lR- lt"V 3R. lR/ lt#]V 3R0 lR1 l4       t$]V 3R2 lR3 l4       t%V 3R4 lR5 lt&]V 3R6 lR7 l4       t'V 3R8 lR9 lt(R:t)V t*R# )?r?  i2  z“Implementation of the WebSocket protocol from RFC 6455.

This class supports versions 7 and 8 of the protocol in addition to the
final version 13.
Nc                ó.   <€ V ^8„  d   QhRRRS[ RS[RR/# )r&   rX  rQ   Úmask_outgoingrA  r(   N)rÚ   r�   )r+   r,   s   "€r-   r.   Ú WebSocketProtocol13.__annotate__C  s3   ø€ ÷ !$ñ !$à%ð!$ñ ð!$ñ !ð	!$ð
 
ñ!$r0   c                ót  € \         P                  W4       W n        W0n        R V n        RV n        RV n        RV n        RV n        RV n	        RV n
        RV n        VP                  V n        RV n        RV n        RV n        ^ V n        ^ V n        ^ V n        ^ V n        R V n        RV n        RV n        RV n        R# )FN)r:  r‹   rÝ  rA  Ú_final_frameÚ_frame_opcodeÚ_masked_frameÚ_frame_maskÚ_frame_lengthÚ_fragmented_message_bufferÚ_fragmented_message_opcodeÚ_waitingr†   Ú_compression_optionsrÑ  r»  Ú_frame_compressedÚ_message_bytes_inÚ_message_bytes_outÚ_wire_bytes_inÚ_wire_bytes_outÚ_received_pongrT   rU   Ú_ping_coroutine)r5   rX  rÝ  rA  s   &&&&r-   r‹   ÚWebSocketProtocol13.__init__C  sÅ   € ô 	×"Ñ" 4Ô1Ø*ÔØŒØ!ˆÔØ!ˆÔØ!ˆÔØˆÔØ!ˆÔØ*.ˆÔ'Ø*.ˆÔ'ØˆŒØ$*×$>Ñ$>ˆÔ!Ø!ˆÔØˆÔØ!%ˆÔð "#ˆÔØ"#ˆÔð  ˆÔØ ˆÔØ#ˆÔØˆŒØ ˆÔØ#ˆÖr0   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rÆ   rë   )r+   r,   s   "€r-   r.   rÞ  h  s   ø€ ÷ *ñ *¡h©s¥mñ *r0   c                ó   € V P                   # r2   ©Ú_selected_subprotocolrÌ   s   &r-   rí   Ú(WebSocketProtocol13.selected_subprotocolg  s   € à×)Ñ)Ð)r0   c                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# r!  rë   )r+   r,   s   "€r-   r.   rÞ  l  s   ø€ ÷ +ñ +©(±3­-ð +¸Dñ +r0   c                ó   € Wn         R # r2   ró  r%  s   &&r-   rí   rõ  k  s   € à%*Ö"r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# r~  r  )r+   r,   s   "€r-   r.   rÞ  o  s   ø€ ÷ ñ Ñ/?ð ÀDñ r0   c              ƒ  óÄ  "  €  V P                  V4        T P                  T4      G Rj  x€L
  R#   \         d?    TP                  R 4       RpTP                  T4       \        P
                  ! T4        R# i ; i LR  \        P                   d    T P                  4         R# \         d-    \        P
                  ! RRR7       T P                  4         R# i ; i5i)r¨   ú!Missing/Invalid WebSocket headersNz$Malformed WebSocket request receivedT©rl  )
Ú_handle_websocket_headersr´  r¸   r¹   r   rº   Ú_accept_connectionÚasyncioÚCancelledErrorrm  )r5   rX  rÁ   s   && r-   r¿   Ú%WebSocketProtocol13.accept_connectiono  s¸   é € ð	Ø×*Ñ*¨7Ô3ð	Ø×)Ñ)¨'Ó2×2Ò2øô ô 	Ø×Ñ˜sÔ#Ø9ˆGØ�N‰N˜7Ô#Ü�MŠM˜'Ô"Úð	úñ 3øÜ×%Ñ%ô 	Ø�K‰KŒMÚÜô 	Ü�MŠMÐ@È4ÕPØ�K‰KŒMÚð	üse   ‚C „1 –A? ªA=«A? ¯C ±AA:Á6C Á9A:Á:C Á=A? Á?%CÂ$C Â'CÂ0)CÃC ÃCÃC c                ó$   <€ V ^8„  d   QhRS[ RR/# r~  r  )r+   r,   s   "€r-   r.   rÞ  ƒ  s    ø€ ÷ Bñ BÑ1Að BÀdñ Br0   c                ó`   a€ Rp\        \        V3R lV4      4      '       g   \        R4      hR# )zzVerifies all invariant- and required headers

If a header is missing or have an incorrect value ValueError will be
raised
c                 óN   <€ SP                   P                  P                  V 4      # r2   )r’   r¶   r·   )re  rX  s   &€r-   r­   Ú?WebSocketProtocol13._handle_websocket_headers.<locals>.<lambda>Š  s   ø€  §¡×!8Ñ!8×!<Ñ!<¸QÔ!?r0   rú  N)r  úSec-Websocket-KeyzSec-Websocket-Version)Úallr»   r´  )r5   rX  Úfieldss   &f r-   rü  Ú-WebSocketProtocol13._handle_websocket_headersƒ  s0   ø€ ð HˆÜ”3Ô?ÀÓH×IÒIÜÐ@ÓAÐAñ Jr0   c                ó<   <€ V ^8„  d   QhRS[ S[S[3,          RS[/# )r&   r‘  r(   rÿ   )r+   r,   s   "€r-   r.   rÞ  Ž  s$   ø€ ÷ ;ñ ;¡%©©U¨
Õ"3ð ;¹ñ ;r0   c                óÜ   € \         P                  ! 4       pVP                  \        V 4      4       VP                  R4       \	        \
        P                  ! VP                  4       4      4      # )z_Computes the value for the Sec-WebSocket-Accept header,
given the value for Sec-WebSocket-Key.
s$   258EAFA5-E914-47DA-95CA-C5AB0DC85B11)ÚhashlibÚsha1Úupdater   r   Úbase64Ú	b64encodeÚdigest)r‘  r  s   & r-   Úcompute_accept_valueÚ(WebSocketProtocol13.compute_accept_value�  sH   € ô
 �|Š|‹~ˆØ�‰”D˜“IÔØ�‰Ð;Ô<Üœ&×*Ò*¨4¯;©;«=Ó9Ó:Ð:r0   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   rX  r(   )r�   rW   )r+   r,   s   "€r-   r.   rÞ  —  s   ø€ ÷ 
ñ 
Ñ+;ð 
Áñ 
r0   c                óŽ   € \         P                  \        \        VP                  P
                  P                  R 4      4      4      # )r  )r?  r  r   rW   r’   r¶   r·   r^  s   &&r-   Ú_challenge_responseÚ'WebSocketProtocol13._challenge_response—  s5   € Ü"×7Ñ7Ü”�g—o‘o×-Ñ-×1Ñ1Ð2EÓFÓGó
ð 	
r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# r~  r  )r+   r,   s   "€r-   r.   rÞ  œ  s   ø€ ÷ 1)ñ 1)Ñ0@ð 1)ÀTñ 1)r0   c           	   ƒ  óx  "  € VP                   P                  P                  R 4      pV'       d/   VP                  R4       Uu. uF  q3P	                  4       NK  	  ppM. pVP                  V4      V n        V P                  '       d0   V P                  V9   g   Q hVP                  R V P                  4       V P                  VP                   P                  4      pV FŸ  pV^ ,          R8X  g   K  V P                  f   K#  V P                  RV^,          V P                  4       RV^,          9   d   V^,          R,          f   V^,          R VP                  R\        P                  ! RV^,          4      4        M	  VP                  R4       VP                  ^e4       VP                  RR	4       VP                  R
R4       VP                  RV P                  V4      4       VP!                  4        VP#                  4       V n        V P'                  4         VP(                  ! VP*                  / VP,                  B pVe   VG Rj  x€L
  T P9                  4       G Rj  x€L
  R# u upi  L#  \.         d8    TP0                  ! \2        P4                  ! 4       !   T P7                  4         R# i ; i LR5i)úSec-WebSocket-Protocolr°   úpermessage-deflateNÚserverÚclient_max_window_bitsúSec-WebSocket-ExtensionszContent-Typer¥   r§   r¯   zSec-WebSocket-Accept)r’   r¶   r·   r¼   rª   rè   rí   rÀ   Ú_parse_extensions_headerrè  Ú_create_compressorsr
   Ú_encode_headerÚclear_headerr¸   r  r¹   rL  r[  r™  rõ   r´   rµ   rj  rt   rk  rl  rm  r�  )r5   rX  Úsubprotocol_headerr¬   ræ   Ú
extensionsÚextÚopen_results   &&      r-   rý  Ú&WebSocketProtocol13._accept_connectionœ  sR  é € Ø$Ÿ_™_×4Ñ4×8Ñ8Ð9QÓRÐßØ/A×/GÑ/GÈÔ/LÓMÑ/L¨!ŸG™GžIÑ/LˆLÐMˆLàˆLØ$+×$>Ñ$>¸|Ó$LˆÔ!Ø×$×$Ð$Ø×,Ñ,°Ô<Ð<Ð<Ø×ÑÐ7¸×9RÑ9RÔSà×2Ñ2°7·?±?×3JÑ3JÓKˆ
ÛˆCØ�1�vÐ-Ö-°$×2KÑ2KÔ2Wð ×(Ñ(¨°3°qµ6¸4×;TÑ;TÔUà,°°AµÔ6Ø˜A�Ð7Õ8Ò@ð ˜A�Ð7Ð8Ø×"Ñ"Ø.Ü×+Ò+Ð,@À#ÀaÅ&ÓIôñ ñ! ð$ 	×Ñ˜^Ô,Ø×Ñ˜3ÔØ×Ñ˜9 kÔ2Ø×Ñ˜<¨Ô3Ø×ÑÐ1°4×3KÑ3KÈGÓ3TÔUØ�‰Ôà×,Ñ,Ó.ˆŒà×ÑÔð	Ø!Ÿ,š,¨×(9Ñ(9ÐQ¸W×=PÑ=PÑQˆKØÒ&Ø!×!Ð!ð ×&Ñ&Ó(×(Ò(ùò] NñP "øÜô 	Ø×!Ò!¤3§<¢<£>Ò2Ø�K‰KŒMÚð	úñ
 	)ùsh   ‚AJ:ÁI,Á,J:ÂA$J:Ã1J:ÄDJ:È/I3 ÉI1ÉI3 ÉJ:É%J8É&J:É1I3 É3>J5Ê1J:Ê4J5Ê5J:c          	      óv   <€ V ^8„  d   QhRS[ P                  RS[S[S[S[S[S[3,          3,          ,          /# )r&   r¶   r(   )r
   r“  r   r   rW   r   )r+   r,   s   "€r-   r.   rÞ  Ï  s:   ø€ ÷ ñ Ù×+Ñ+ðá	‰e‘C™™c¡3˜h�Ð'Õ(Õ	)ñr0   c                óÊ   € VP                  R R4      pV'       dD   VP                  R4       Uu. uF'  p\        P                  ! VP	                  4       4      NK)  	  up# . # u upi )r  r¦   r°   )r·   r¼   r
   Ú_parse_headerrª   )r5   r¶   r#  Úes   &&  r-   r  Ú,WebSocketProtocol13._parse_extensions_headerÏ  sW   € ð —[‘[Ð!;¸RÓ@ˆ
ßØ?I×?OÑ?OÐPSÔ?TÓUÑ?T¸!”H×*Ò*¨1¯7©7«9Ö5Ñ?TÑUÐUØˆ	ùò Vs   ®-A c                óT   <€ V ^8„  d   QhRS[ S[S[3,          RS[P                  RR/# r�  r’  )r+   r,   s   "€r-   r.   rÞ  ×  s9   ø€ ÷ Pñ PÙ™™e˜Õ$ðPÙ/7×/CÑ/CðPà	ñPr0   c                ó¤  € VR,          P                  4       R8X  g   Q hVR,          P                  4       R8X  g   Q hV P                  V4      pVR,          V8X  g   Q hV P                  V4      pV FD  pV^ ,          R8X  d*   V P                  e   V P	                  RV^,          4       K:  \        R	V4      h	  VP                  R
R4      V n        R# )z|Process the headers sent by the server to this client connection.

'key' is the websocket handshake challenge/response key.
r¥   r§   r¯   r±   zSec-Websocket-Acceptr  NÚclientzunsupported extension %rr  )r«   r  r  rè  r  r´  r·   rí   )r5   r‘  r¶   Úacceptr#  r$  s   &&&   r-   r•  Ú+WebSocketProtocol13._process_server_headers×  sÊ   € ð �yÕ!×'Ñ'Ó)¨[Ô8Ð8Ð8Ø�|Õ$×*Ñ*Ó,°	Ô9Ð9Ð9Ø×*Ñ*¨3Ó/ˆØÐ-Õ.°&Ô8Ð8Ð8à×2Ñ2°7Ó;ˆ
ÛˆCØ�1�vÐ-Ô-°$×2KÑ2KÒ2WØ×(Ñ(¨°3°qµ6Ö:ä Ð!;¸SÓAÐAñ	 ð %,§K¡KÐ0HÈ$Ó$OˆÖ!r0   c          
      ó„   <€ V ^8„  d   QhRS[ RS[S[ S[3,          RS[S[S[ S[3,          ,          RS[S[ S[3,          /# )r&   ÚsideÚagreed_parametersr†   r(   ©rW   r   r   r   )r+   r,   s   "€r-   r.   rÞ  ì  sP   ø€ ÷ ñ áðñ  ¡¡S �>ðñ &¡d©3±¨8¥nÕ5ð	ñ
 
‰c‘3ˆh�ñr0   c                ó¸   € \        VR,           V9  R7      pVP                  VR,           R4      pVf   \        P                  VR&   M\	        V4      VR&   W4R&   V# )z\Converts a websocket agreed_parameters set to keyword arguments
for our compressor objects.
Ú_no_context_takeover)rª  Ú_max_window_bitsNr«  r†   )rß   r·   r²  r³  r<   )r5   r2  r3  r†   ÚoptionsÚwbits_headers   &&&&  r-   Ú_get_compressor_optionsÚ+WebSocketProtocol13._get_compressor_optionsì  sh   € ô ØÐ5Õ5Ð>OÑOô
ˆð )×,Ñ,¨TÐ4FÕ-FÈÓMˆØÒÜ#'§>¡>ˆG�KÒ ä#& |Ó#4ˆG�KÑ Ø)<Ð%Ñ&Øˆr0   c          	      ól   <€ V ^8„  d   QhRS[ RS[S[ S[3,          RS[S[S[ S[3,          ,          RR/# )r&   r2  r3  r†   r(   Nr4  )r+   r,   s   "€r-   r.   rÞ     sH   ø€ ÷ 
ñ 
áð
ñ  ¡¡S �>ð
ñ &¡d©3±¨8¥nÕ5ð	
ð
 
ñ
r0   c           	     ó  € 0 RmpV F  pWT9  g   K  \        RV,          4      h	  VR8X  d   RMRp\        R/ V P                  WV4      B V n        \	        RRV P
                  P                  /V P                  WbV4      B V n        R# )Úserver_no_context_takeoverz$unsupported compression parameter %rr  r.  r…   N>   r  Úserver_max_window_bitsÚclient_no_context_takeoverr>  r3   )r´  r¨  r:  r»  rË  rA  r…   rÑ  )r5   r2  r3  r†   Úallowed_keysr‘  Ú
other_sides   &&&&   r-   r  Ú'WebSocketProtocol13._create_compressors   s™   € ò
ˆó %ˆCØÖ&Ü Ð!GÈ#Õ!MÓNÐNñ %ð #'¨(Ô"2‘X¸ˆ
Ü7ñ 
Ø×*Ñ*¨4ÐDWÓXñ
ˆÔô <ñ 
Ø!Ÿ[™[×9Ñ9ð
à×*Ñ*ØÐ/Bóñ
ˆÖr0   c          
      ó6   <€ V ^8„  d   QhRS[ RS[RS[RS[RR/# )r&   ÚfinÚopcoder'   Úflagsr(   rÙ   )rÚ   r<   r*   )r+   r,   s   "€r-   r.   rÞ    s5   ø€ ÷ (ñ (Ùð(Ù!$ð(Ù,1ð(Ù:=ð(à	ñ(r0   c                ó"  € \        V4      pV^,          '       d&   V'       g   \        R4      hV^}8”  d   \        R4      hV'       d   V P                  pM^ p\        P                  ! RWb,          V,          4      pV P
                  '       d   ^€pM^ pV^~8  d&   V\        P                  ! RWX,          4      ,          pMTVR8:  d(   V\        P                  ! R^~V,          V4      ,          pM&V\        P                  ! R^V,          V4      ,          pV P
                  '       d)   \        P                  ! ^4      p	V	\        W“4      ,           pWs,          pV ;P                  \        V4      ,          un	        V P                  P                  V4      # )é   z$control frames may not be fragmentedz/control frame payloads may not exceed 125 bytesÚBiÿÿ  z!BHz!BQ)Úlenr´  ÚFINÚstructÚpackrÝ  ÚosÚurandomr   rí  r[  rE  )
r5   rE  rF  r'   rG  Údata_lenÚfinbitÚframeÚmask_bitÚmasks
   &&&&&     r-   Ú_write_frameÚ WebSocketProtocol13._write_frame  s.  € ô �t“9ˆØ�C�<Œ<÷ Ü Ð!GÓHÐHØ˜#Œ~Ü Ð!RÓSÐSßØ—X‘X‰FàˆFÜ—’˜C ¥°5Õ!8Ó9ˆØ××ÐØ‰HàˆHØ�cŒ>Ø”V—[’[  hÕ&9Ó:Õ:‰EØ˜ÔØ”V—[’[ ¨¨h­¸ÓAÕA‰Eà”V—[’[ ¨¨h­¸ÓAÕAˆEØ××ÐÜ—:’:˜a“=ˆDØœ/¨$Ó5Õ5ˆDØ�ˆØ×Ò¤ E£
Õ*ÕØ�{‰{× Ñ  Ó'Ð'r0   c                óZ   <€ V ^8„  d   QhRS[ S[S[S[S[S[3,          3,          RS[RR/# r×   r…  )r+   r,   s   "€r-   r.   rÞ  <  s9   ø€ ÷ !0ñ !0Ù™S¡%©©c±3¨h­Ð7Õ8ð!0ÙBFð!0à	ñ!0r0   c                ó`  a€ V'       d   ^pM^p\        V\        4      '       d    \        P                  P	                  V4      p\        P                  P                  V4      p\        V\        4      '       g   Q hV ;P                  \        V4      ,          un        ^ pV P                  '       d.   V P                  P                  V4      pW@P                  ,          p V P                  RW1VR7      oR T3R llp\        P                   ! T! 4       4      #   \         d    \        4       hi ; i)z9Sends the given message to the client of this Web Socket.T)rG  c                ó   € V ^8„  d   QhRR/# r  r3   )r+   s   "r-   r.   Ú7WebSocketProtocol13.write_message.<locals>.__annotate__W  s   € ÷ 	-ñ 	-˜tñ 	-r0   c               “   ó\   <"  €  S G R j  x€L
  R #  L  \          d    \        4       hi ; i5ir2   )r   r|   )Úfuts   €r-   ÚwrapperÚ2WebSocketProtocol13.write_message.<locals>.wrapperW  s)   øé € ð-Ø—	”	øÜ$ô -Ü*Ó,Ð,ð-üs    ƒ,… Š‹ �,‘ “)©,)rÞ   rß   r”   rà   rá   r   r*   rë  rK  r»  r6   ÚRSV1rV  r   r|   rþ  Úensure_future)r5   r^   rØ   rF  rG  r^  r]  s   &&&   @r-   râ   Ú!WebSocketProtocol13.write_message<  s÷   ø€ ÷ Ø‰FàˆFÜ�gœt×$Ò$Ü—n‘n×0Ñ0°Ó9ˆGÜ—.‘.×%Ñ% gÓ.ˆÜ˜'¤5×)Ò)Ð)Ð)Ø×Ò¤3 w£<Õ/ÕØˆØ××ÐØ×&Ñ&×/Ñ/°Ó8ˆGØ—Y‘YÕˆEð	)Ø×#Ñ# D¨&ÀÐ#ÓGˆC÷	-ð 	-ô ×$Ò$¡W£YÓ/Ð/øô !ô 	)Ü&Ó(Ð(ð	)ús   ÃD ÄD-c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   rÞ  _  s   ø€ ÷ +ñ +™uð +¨ñ +r0   c                ó\   € \        V\        4      '       g   Q hV P                  R^	V4       R# )zSend ping frame.TN)rÞ   r*   rV  r4   s   &&r-   r  ÚWebSocketProtocol13.write_ping_  s'   € ä˜$¤×&Ò&Ð&Ð&Ø×Ñ˜$  TÖ*r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rÞ  d  s   ø€ ÷ Pñ P¨4ñ Pr0   c              ƒ  ó  "  €  V P                   '       g   V P                  4       G R j  x€L
  K,   V P                  P                  V P                  V P                  4       R #  L9  \         d    T P                  4         LQi ; i5ir2   )r\  Ú_receive_framer   rm  rX  r[   rT   rU   rÌ   s   &r-   r�  Ú'WebSocketProtocol13._receive_frame_loopd  si   é € ð	Ø×,×,Ð,Ø×)Ñ)Ó+×+Ò+ð -ð 	�‰×+Ñ+¨D¯O©O¸T×=NÑ=NÖOñ ,øÜ ô 	Ø�K‰KŽMð	üs<   ‚B„A% –A% ©A#ªA% °3BÁ#A% Á%BÂ BÂBÂBc                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   Únr(   r;   )r+   r,   s   "€r-   r.   rÞ  l  s   ø€ ÷ ñ ¡3ð ©5ñ r0   c              ƒ  óŠ   "  € V P                   P                  V4      G R j  x€L
 pV ;P                  V,          un        V#  L5ir2   )r[  Ú
read_bytesrì  )r5   rk  r'   s   && r-   Ú_read_bytesÚWebSocketProtocol13._read_bytesl  s7   é € Ø—[‘[×+Ñ+¨AÓ.×.ˆØ×Ò˜qÕ ÕØˆñ /ùs   ‚A¡A¢ Ac                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rÞ  q  s   ø€ ÷ Q%ñ Q% dñ Q%r0   c              ƒ  ó  "  € V P                  ^4      G Rj  x€L
 p\        P                  ! RV4      w  r#W P                  ,          pW P                  ,          pW P
                  ,          pV^,          pV P                  e;   V^ 8w  d4   \        WPP                  ,          4      V n	        WPP                  ( ,          pV'       d   V P                  4        R# \        V^€,          4      pV^,          p	V'       d   V	^~8¼  d   V P                  4        R# V	^~8  d   W�n        M}V	^~8X  d9   V P                  ^4      G Rj  x€L
 p\        P                  ! RV4      ^ ,          p	M>V	^8X  d8   V P                  ^4      G Rj  x€L
 p\        P                  ! RV4      ^ ,          p	T	p
V P                  e   V
\        V P                  4      ,          p
W P                  P                  8”  d%   V P!                  RR4       V P                  4        R# V'       d   V P                  ^4      G Rj  x€L
 V n        V P                  V	4      G Rj  x€L
 pV'       d'   V P"                  f   Q h\%        V P"                  V4      pV'       d   V'       g   V P                  4        R# M±V^ 8X  dm   V P                  f   V P                  4        R# V P                  P'                  V4       V'       d)   V P(                  p\+        V P                  4      pRV n        M>V P                  e   V P                  4        R# V'       g   W`n        \-        V4      V n        V'       d$   V P/                  Wa4      pVe   VG Rj  x€L
  R# R# R#  EL^ EL= EL EL[ EL@ L5i)r&   NÚBBz!Hz!Qéñ  zmessage too big)rn  rM  ÚunpackrL  ÚRSV_MASKÚOPCODE_MASKrÑ  rÚ   r`  ré  rm  rä  rå  rK  rA  r…   r  rã  r   Úextendræ  r*   Ú	bytearrayÚ_handle_message)r5   r'   ÚheaderÚmask_payloadlenÚis_final_frameÚreserved_bitsrF  Úopcode_is_controlÚ	is_maskedÚ
payloadlenÚnew_lenÚhandled_futures   &           r-   rh  Ú"WebSocketProtocol13._receive_frameq  sÓ  é € à×%Ñ% aÓ(×(ˆÜ"(§-¢-°°dÓ";ÑˆØ§(¡(Õ*ˆØ§¡Õ.ˆØ×*Ñ*Õ*ˆØ" S�LÐØ×ÑÒ)¨f¸¬kô &*¨-¿)¹)Õ*CÓ%DˆDÔ"ØŸi™i˜ZÕ'ˆMßà�K‰KŒMÙÜ˜¨4Õ/Ó0ˆ	Ø$ tÕ+ˆ
÷  ¨sÔ!2à�K‰KŒMÙØ˜ÔØ!+ÕØ˜3ÔØ×)Ñ)¨!Ó,×,ˆDÜŸš t¨TÓ2°1Õ5‰JØ˜3ÔØ×)Ñ)¨!Ó,×,ˆDÜŸš t¨TÓ2°1Õ5ˆJØˆØ×*Ñ*Ò6Ø”s˜4×:Ñ:Ó;Õ;ˆGØ—[‘[×1Ñ1Ô1Ø�J‰J�tÐ.Ô/Ø�K‰KŒMÙ÷ Ø%)×%5Ñ%5°aÓ%8×8ˆDÔØ×%Ñ% jÓ1×1ˆßØ×#Ñ#Ò/Ð/Ð/Ü" 4×#3Ñ#3°TÓ:ˆD÷ ÷ "à—‘”Ùð "ð �qŒ[Ø×.Ñ.Ò6à—‘”ÙØ×+Ñ+×2Ñ2°4Ô8ßØ×8Ñ8�Ü˜T×<Ñ<Ó=�Ø26�Ô/øà×.Ñ.Ò:à—‘”Ùß!Ø28Ô/Ü2;¸D³/�Ô/çØ!×1Ñ1°&Ó?ˆNØÒ)Ø$×$Ò$ñ *ñ òY )ò6 -ò -ò  9Ú1ñH %ùsž   ‚N—M5˜B+NÃA7NÄ;M8Ä<>NÅ:M;Å;BNÈNÈ#M>È$NÉNÉNÉ-NÉ<NÊANË!ANÌ2NÍNÍ*NÍ+NÍ8NÍ;NÍ>NÎNÎNc                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r&   rF  r'   r(   zOptional[Future[None]]r;   )r+   r,   s   "€r-   r.   rÞ  Ä  s#   ø€ ÷ 1ñ 1¡cð 1±ð 1Ð;Sñ 1r0   c                ó  € V P                   '       d   R# V P                  '       d-   V P                  f   Q h V P                  P                  V4      pV^8X  d[   V ;P                  \        V4      ,          un         VP                  R4      pT P                  T P                  P                  T4      # V^8X  dI   V ;P                  \        V4      ,          un        V P                  V P                  P                  V4      # V^8X  d†   RV n         \        V4      ^8¼  d+   \        P                  ! RVR,          4      ^ ,          V n        \        V4      ^8”  d   \#        VR,          4      V n        V P                  V P                   4       R# V^	8X  d=    V P'                  R^
V4       V P                  V P                  P*                  V4       R# V^
8X  d.   RV n        V P                  V P                  P.                  V4      # V P                  4        R#   \         d'    T P                  RR4       T P                  4         R# i ; i  \         d    T P                  4         R# i ; i  \(         d    T P                  4         Lái ; i)	z>Execute on_message, returning its Future if it is a coroutine.Nrs  z#message too big after decompressionzutf-8Tú>H:Nr&   N:r&   NN)r\  ré  rÑ  rM   r   r  rm  rê  rK  ÚdecodeÚUnicodeDecodeErrorrn  rX  ra   rM  rt  rT   r   rU   rV  r   rg   rî  rk   )r5   rF  r'   Údecodeds   &&& r-   ry  Ú#WebSocketProtocol13._handle_messageÄ  s  € à×!×!Ð!Ùà×!×!Ð!Ø×%Ñ%Ò1Ð1Ð1ðØ×)Ñ)×4Ñ4°TÓ:�ð �SŒ=à×"Ò"¤c¨$£iÕ/Õ"ðØŸ+™+ gÓ.�ð ×%Ñ% d§l¡l×&=Ñ&=¸wÓGÐGØ�sŒ]à×"Ò"¤c¨$£iÕ/Õ"Ø×%Ñ% d§l¡l×&=Ñ&=¸tÓDÐDØ�sŒ]à%)ˆDÔ"Ü�4‹y˜AŒ~Ü"(§-¢-°°d¸2µhÓ"?ÀÕ"B�”Ü�4‹y˜1Œ}Ü$.¨t°B­xÓ$8�Ô!à�J‰J�t—‘Ô'ñ ð �sŒ]ðØ×!Ñ! $¨¨TÔ2ð ×Ñ˜tŸ|™|×3Ñ3°TÔ:ñ ð �sŒ]à"&ˆDÔØ×%Ñ% d§l¡l×&:Ñ&:¸DÓAÐAà�K‰KŒMÙøôQ ,ô Ø—
‘
˜4Ð!FÔGØ—‘”Úðûô &ô Ø—‘”Úðûô* %ô Ø—‘–ðús5   ¸H Á=I ÆI. È-I	ÉI	ÉI+É*I+É.JÊJc                óJ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RR/# r  rV   )r+   r,   s   "€r-   r.   rÞ  ÷  s+   ø€ ÷ (ñ (™(¡3�-ð (¹Á½ð (ÐQUñ (r0   c                ó„  € V P                   '       gz   V P                  P                  4       '       gS   Vf   Ve   RpVf   RpM\        P                  ! RV4      pVe   V\        V4      ,          p V P                  R^V4       RV n         V P                  '       d`   V P                  e7   V P                  P                  P                  V P                  4       RV n
        V P                  P                  4        MlV P                  f_   V P                  P                  P                  V P                  P                  P                  4       ^,           V P                  4      V n
        V P                   '       d$   V P                   P#                  4        RV n        R# R#   \         d    T P                  4         EL9i ; i)z Closes the WebSocket connection.Niè  r0   r†  T)r]  r[  ÚclosedrM  rN  r   rV  r   rm  r\  rç  rh  Úremove_timeoutr  Úadd_timeoutÚtimerï  Úcancel)r5   r  r  Ú
close_datas   &&& r-   r  ÚWebSocketProtocol13.close÷  sX  € à×%×%Ð%Ø—;‘;×%Ñ%×'Ò'Ø’< FÒ$6Ø�DØ’<Ø!$‘Jä!'§¢¨T°4Ó!8�JØÒ%Ø¤$ v£,Õ.�Jð"Ø×%Ñ% d¨C°Ô<ð &*ˆDÔ"Ø×!×!Ð!Ø�}‰}Ò(Ø—‘×#Ñ#×2Ñ2°4·=±=ÔAØ $�”Ø�K‰K×ÑÕØ�]‰]Ò"ð !ŸK™K×/Ñ/×;Ñ;Ø—‘×#Ñ#×(Ñ(Ó*¨QÕ.°·±óˆDŒMð ××ÐØ× Ñ ×'Ñ'Ô)Ø#'ˆDÖ ñ  øô )ô "Ø—K‘K—Mð"ús   Á2F  Æ F?Æ>F?c                ó    <€ V ^8„  d   QhRS[ /# rÆ   r"  )r+   r,   s   "€r-   r.   rÞ    s   ø€ ÷ Xñ X™Dñ Xr0   c                ó†   € V P                   P                  4       ;'       g!    V P                  ;'       g    V P                  # )z·Return ``True`` if this connection is closing.

The connection is considered closing if either side has
initiated its closing handshake or if the stream has been
shut down uncleanly.
)r[  r�  r\  r]  rÌ   s   &r-   rÝ   ÚWebSocketProtocol13.is_closing  s3   € ð �{‰{×!Ñ!Ó#×WÐW t×'=Ñ'=×WÐWÀ×AWÑAWÐWr0   c                ó$   <€ V ^8„  d   QhRS[ RR/# r   r"  )r+   r,   s   "€r-   r.   rÞ     s   ø€ ÷ #ñ #™Tð # dñ #r0   c                ó<   € V P                   P                  V4       R # r2   )r[  r$  r£  s   &&r-   r$  ÚWebSocketProtocol13.set_nodelay   s   € Ø�‰×Ñ Ö"r0   c                ó    <€ V ^8„  d   QhRS[ /# rÆ   ©r‡   )r+   r,   s   "€r-   r.   rÞ  $  s   ø€ ÷ ñ ™uñ r0   c                ó>   € V P                   P                  pVe   V# ^ # r2   )rA  rƒ   )r5   Úintervals   & r-   rƒ   Ú!WebSocketProtocol13.ping_interval#  s   € à—;‘;×,Ñ,ˆØÒØˆOÙr0   c                ó    <€ V ^8„  d   QhRS[ /# rÆ   r›  )r+   r,   s   "€r-   r.   rÞ  +  s   ø€ ÷ "ñ "™eñ "r0   c           	     ó  € V P                   P                  pVeh   V P                  '       dT   WP                  8”  dD   \        \        P
                  RV RV P                   RV P                   24       V P                  # V# V P                  # )NzThe websocket_ping_timeout (z5) cannot be longer than the websocket_ping_interval (z").
Setting websocket_ping_timeout=)rA  r„   rƒ   Úde_dupe_gen_logÚloggingÚWARNING)r5   Útimeouts   & r-   r„   Ú WebSocketProtocol13.ping_timeout*  sŽ   € à—+‘+×*Ñ*ˆØÒØ×!×!Ð! g×0BÑ0BÔ&BÜô —O‘OØ2°7°)ð <:Ø:>×:LÑ:LÐ9Mð N8Ø8<×8JÑ8JÐ7KðMô	ð ×)Ñ)Ð)ØˆNØ×!Ñ!Ð!r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rÞ  ;  s   ø€ ÷ Mñ M˜tñ Mr0   c                ó¦   € V P                   '       g?   V P                  ^ 8”  d,   \        P                  ! V P	                  4       4      V n         R# R# R# )z9Start sending periodic pings to keep the connection aliveN)rï  rƒ   rþ  Úcreate_taskÚperiodic_pingrÌ   s   &r-   r™  Ú!WebSocketProtocol13.start_pinging;  sD   € ð ×$×$Ð$à×"Ñ" QÔ&ä#*×#6Ò#6°t×7IÑ7IÓ7KÓ#LˆDÖ ñ 'ñ %r0   c                ó2   <€ V ^8„  d   QhRS[ RS[ RS[ RS[ /# )r&   Úlast_ping_timer�  Únowr(   r›  )r+   r,   s   "€r-   r.   rÞ  F  s*   ø€ ÷ 7ñ 7©5ð 7¹Eð 7Éð 7ÑRWñ 7r0   c                ó4   € \        ^ W,           V,
          4      # )z<Calculate the sleep time until the next ping should be sent.)Úmax©r¬  r�  r­  s   $$$r-   Úping_sleep_timeÚ#WebSocketProtocol13.ping_sleep_timeE  s   € ô �1�nÕ/°#Õ5Ó6Ð6r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rÞ  J  s   ø€ ÷ ñ  Tñ r0   c              ƒ  ó6  "  € V P                   pV P                  p\        P                  ! V4      G Rj  x€L
   RV n        \
        P                  ! 4       P                  4       pV P                  R4       \        P                  ! V4      G Rj  x€L
  V^ 8”  d'   V P                  '       g   V P                  RR7       R# \        P                  ! V P                  VV\
        P                  ! 4       P                  4       R7      4      G Rj  x€L
  KÚ   LÞ L† L
5i)zˆSend a ping and wait for a pong if ping_timeout is configured.

Called periodically if the websocket_ping_interval is set and non-zero.
NFr0   zping timed out)r  r°  )rƒ   r„   rþ  Úsleeprî  r   Úcurrentr�  r  r  r±  )r5   r�  r¤  Ú	ping_times   &   r-   r©  Ú!WebSocketProtocol13.periodic_pingJ  sè   é € ð
 ×%Ñ%ˆØ×#Ñ#ˆä�mŠm˜HÓ%×%Ð%àà"'ˆDÔÜŸšÓ(×-Ñ-Ó/ˆIØ�O‰O˜CÔ ô —-’- Ó(×(Ð(ð ˜Œ{ 4×#6×#6Ð#6Ø—
‘
Ð"2�
Ô3Ùô —-’-Ø×$Ñ$Ø#,Ø%ÜŸšÓ(×-Ñ-Ó/ð %ó ó÷ ò ñ# 	&ñ )ñùs;   ‚2D´DµADÂDÂDÂ,A DÄDÄDÄDÄD)rè  r»  rÑ  rà  rå  ræ  ré  rä  rã  rá  râ  rê  rë  rï  rî  rô  rç  rì  rí  r\  rT   rU   rÝ  rA  rí   r]  r[  r2   )é    rN  rv   )+r@   rA   rB   rC   r}   rL  r`  ÚRSV2ÚRSV3ru  rv  r[  r‹   rP  rí   Úsetterr¿   rü  Ústaticmethodr  r  rý  r  r•  r:  r  rV  râ   r  r�  rn  rh  ry  r  rÝ   r$  rƒ   r„   r™  r±  r©  rD   rE   rF   s   @r-   r?  r?  2  s›  ø‡ € ñð €CØ€DØ€DØ€DØ�d�{˜TÕ!€HØ€Kà€F÷!$ð !$ðH ÷*ó ð*ð × Ñ ÷+ó !ð+÷ð ÷(Bð Bð ÷;ó ð;÷
ð 
÷
1)ð 1)÷fð ÷Pð P÷*ò ÷(
ò 
÷6(ò (÷B!0ò !0÷F+ð +÷
Pð P÷ð ÷
Q%ð Q%÷f1ð 1÷f(ò (÷@Xð X÷#ð #ð ÷ó ðð ÷"ó ð"÷ Mð Mð ÷7ó ð7÷ö r0   r?  c                   ó¢  a a€ ] tR tRt oRtRtRRRR]RR3V3R lV 3R llltV3R lR ltR'V3R lR	 llt	V3R
 lV 3R llt
R'V3R lR lltV3R lR ltV3R lV 3R lltR(V3R lR lltR)V3R lR lltV3R lR ltV3R lR ltR*V3R lR lltV3R lR ltV3R lR ltV3R  lR! lt]V3R" lR# l4       tV3R$ lR% ltR&tVtV ;t# )+ÚWebSocketClientConnectionil  z|WebSocket client connection.

This class should not be instantiated directly; use the
`websocket_connect` function instead.
Nc                ó  <€ V ^8„  d   QhRS[ P                  RS[S[S[RS[S[3,          .R3,          ,          RS[S[S[S[3,          ,          RS[S[	,          RS[S[	,          RS[
RS[S[S[,          ,          R	S[S[,          R
R/	# )r&   r’   Úon_message_callbackNr†   rƒ   r„   r…   ræ   Úresolverr(   )r	   ÚHTTPRequestr   r   r   rW   r*   r   r   r‡   r<   r   r   )r+   r,   s   "€r-   r.   Ú&WebSocketClientConnection.__annotate__u  s¬   ø€ ÷ <
ñ <
á×'Ñ'ð<
ñ &¡h±°d¹CÁÐ6FÕ0GÐ/HÈ$Ð/NÕ&OÕPð<
ñ &¡d©3±¨8¥nÕ5ð	<
ñ
  ¡•ð<
ñ ™u•oð<
ñ ð<
ñ ™t¡C�yÕ)ð<
ñ ™8Õ$ð<
ð 
ñ<
r0   c	           
     óÎ  <€ \        4       V n        \        ^4      V n        \        P
                  ! \        P                  ! ^4      4      V n        W n	        RV n
        RV n        \        VVVVR7      V n        VP                  P                  R4      w  ršpRRRR/V	,          p	Wš,           V,           Vn        VP                   P#                  RR	R
RR\%        V P                  4      RR/4       Ve   RP'                  V4      VP                   R&   Ve   RVP                   R&   RVn        \+        VR7      V n        \.        SV `a  RVR V P2                  RV P,                  RR4       R# )é   NrŠ   Ú:ÚwsÚhttpÚwssÚhttpsr¥   r§   r¯   zSec-WebSocket-Keyr³   r>  r°   r  z*permessage-deflate; client_max_window_bitsr  F)rÂ  c                  ó   € R # r2   r3   r3   r0   r-   r­   Ú4WebSocketClientConnection.__init__.<locals>.<lambda>«  s   € ‘Dr0   i  @i   )r   Úconnect_futurer   Ú
read_queuer  r  rO  rP  r‘  Ú_on_message_callbackrT   rU   r�   rA  ÚurlÚ	partitionr¶   r  r   ÚjoinÚfollow_redirectsr   Ú
tcp_clientr›   r‹   Ú_on_http_response)r5   r’   rÁ  r†   rƒ   r„   r…   ræ   rÂ  ÚschemeÚsepÚrestrž   s   &&&&&&&&&   €r-   r‹   Ú"WebSocketClientConnection.__init__u  sP  ø€ ô %›hˆÔÜ ›(ˆŒÜ×#Ò#¤B§J¢J¨r£NÓ3ˆŒØ$7Ô!ØˆŒØ ˆÔÜ&Ø'Ø%Ø-Ø 3ô	
ˆŒð $ŸK™K×1Ñ1°#Ó6Ñˆ�TØ˜  wÐ/°Õ7ˆØ•l TÕ)ˆŒØ�‰×Ñà˜;Ø˜iØ#¤Z°·±Ó%9Ø'¨ð	ô	
ð Ò#Ø8;¿¹ÀÓ8NˆG�O‰OÐ4Ñ5ØÒ*ð =ð �O‰OÐ6Ñ7ð
 $)ˆÔ ä#¨XÔ6ˆŒÜ‰ÑØØÙØ×"Ñ"ØØ�O‰OØØö		
r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rÄ  ³  s   ø€ ÷ Qñ Q˜ñ Qr0   c                ó\   € V P                   e   \        P                  ! R\        4       R # R # )Nz"Unclosed WebSocketClientConnection)ÚprotocolÚwarningsÚwarnÚResourceWarningrÌ   s   &r-   Ú__del__Ú!WebSocketClientConnection.__del__³  s"   € Ø�=‰=Ò$ô �MŠMÐ>ÄÖPñ %r0   c                óJ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RR/# r  rV   )r+   r,   s   "€r-   r.   rÄ  ¼  s+   ø€ ÷ !ñ !™(¡3�-ð !¹Á½ð !ÐQUñ !r0   c                ój   € V P                   e%   V P                   P                  W4       RV n         R# R# )zÊCloses the websocket connection.

``code`` and ``reason`` are documented under
`WebSocketHandler.close`.

.. versionadded:: 3.2

.. versionchanged:: 4.0

   Added the ``code`` and ``reason`` arguments.
N)rÝ  r  r  s   &&&r-   r  ÚWebSocketClientConnection.close¼  s,   € ð �=‰=Ò$Ø�M‰M×Ñ Ô-Ø ˆDŽMñ %r0   c                ó   <€ V ^8„  d   QhRR/# r  r3   )r+   r,   s   "€r-   r.   rÄ  Ì  s   ø€ ÷ &ñ & Tñ &r0   c                ó   <€ V P                   P                  4       '       g$   V P                   P                  \        4       4       V P	                  R 4       V P
                  P                  4        \        SV `!  4        R # r2   )	rÎ  ÚdoneÚset_exceptionr   Ú_on_messagerÕ  r  r›   r)  r7  s   &€r-   r)  Ú-WebSocketClientConnection.on_connection_closeÌ  sY   ø€ Ø×"Ñ"×'Ñ'×)Ò)Ø×Ñ×-Ñ-Ô.?Ó.AÔBØ×Ñ˜ÔØ�‰×ÑÔÜ‰Ñ#Ö%r0   c                óJ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RR/# rS   rV   )r+   r,   s   "€r-   r.   rÄ  Ó  r-  r0   c                ó>   € Wn         W n        V P                  4        R # r2   r/  rZ   s   &&&r-   r[   Ú0WebSocketClientConnection.on_ws_connection_closeÓ  r1  r0   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )r&   Úresponser(   N)r	   ÚHTTPResponse)r+   r,   s   "€r-   r.   rÄ  Ú  s!   ø€ ÷ ñ ©*×*AÑ*Að Àdñ r0   c                ó  € V P                   P                  4       '       g`   VP                  '       d(   V P                   P                  VP                  4       R# V P                   P                  \	        R 4      4       R# R# )zNon-websocket responseN)rÎ  rè  Úerrorré  rx   )r5   rð  s   &&r-   rÖ  Ú+WebSocketClientConnection._on_http_responseÚ  sZ   € Ø×"Ñ"×'Ñ'×)Ò)Ø�~�~ˆ~Ø×#Ñ#×1Ñ1°(·.±.ÖAà×#Ñ#×1Ñ1Ü"Ð#;Ó<öñ	 *r0   c                ó|   <€ V ^8„  d   QhRS[ S[P                  S[P                  3,          RS[P                  RR/# )r&   Ú
start_liner¶   r(   N)r   r
   ÚRequestStartLineÚResponseStartLiner“  )r+   r,   s   "€r-   r.   rÄ  ã  sJ   ø€ ÷ Fñ Fá™(×3Ñ3±X×5OÑ5OÐOÕPðFñ ×%Ñ%ðFð 
ñ	Fr0   c              ƒ  óè  <"  € \        V\        P                  4      '       g   Q hVP                  ^e8w  d   \        SV `  W4      G Rj  x€L
  R# V P                  e-   V P                  P                  V P                  4       RV n        W n	        V P                  4       V n        V P                  P                  V P                  V P                  4       V P                  P                  4       V P                  n        \"        P$                  ! 4       P'                  V P                  P(                  4       V P                  P+                  4        RV n        \/        V P0                  V 4       R#  EL&5ir4  )rÞ   r
   rø  r  r›   Úheaders_receivedÚ_timeoutrh  rŽ  r¶   r¾   rÝ  r•  r‘  rÂ   rJ  r[  r   r¶  Úadd_callbackr�  r™  Úfinal_callbackr   rÎ  )r5   rö  r¶   rž   s   &&&€r-   rú  Ú*WebSocketClientConnection.headers_receivedã  s  øé € ô
 ˜*¤h×&@Ñ&@×AÒAÐAÐAØ�?‰?˜cÔ!Ü‘'Ñ*¨:Ó?×?Ð?Ùà�=‰=Ò$Ø�L‰L×'Ñ'¨¯©Ô6Ø ˆDŒMàŒØ×3Ñ3Ó5ˆŒØ�‰×-Ñ-¨d¯h©h¸¿¹ÔEØ#Ÿ™×5Ñ5Ó7ˆ�‰Ôä�ŠÓ×%Ñ% d§m¡m×&GÑ&GÔHØ�‰×#Ñ#Ô%ð #ˆÔä*¨4×+>Ñ+>ÀÖEò+ @ùs   ƒAE2Á	E/Á
D&E2c                óZ   <€ V ^8„  d   QhRS[ S[S[S[S[S[3,          3,          RS[RR/# r×   r…  )r+   r,   s   "€r-   r.   rÄ    s>   ø€ ÷ Cñ CÙ™S¡%©©c±3¨h­Ð7Õ8ðCÙBFðCà	ñCr0   c                ól   € V P                   f   \        R4      hV P                   P                  WR7      # )a  Sends a message to the WebSocket server.

If the stream is closed, raises `WebSocketClosedError`.
Returns a `.Future` which can be used for flow control.

.. versionchanged:: 5.0
   Exception raised on a closed stream changed from `.StreamClosedError`
   to `WebSocketClosedError`.
z!Client connection has been closedrÜ   )rÝ  r|   râ   rã   s   &&&r-   râ   Ú'WebSocketClientConnection.write_message  s2   € ð �=‰=Ò Ü&Ð'JÓKÐKØ�}‰}×*Ñ*¨7Ð*ÓBÐBr0   c                ór   <€ V ^8„  d   QhRS[ S[R.R3,          ,          RS[S[RS[S[3,          ,          /# )r&   ra  zFuture[Union[None, str, bytes]]Nr(   )r   r   r   r   rW   r*   )r+   r,   s   "€r-   r.   rÄ    sC   ø€ ÷ ñ á™8Ð%FÐ$GÈÐ$MÕNÕOðñ 
‘5˜™s¡EÐ)Õ*Õ	+ñr0   c                ó¢   € V P                   P                  4       pVe1   V P                  P                  \        P
                  ! V4      V4       V# )a@  Reads a message from the WebSocket server.

If on_message_callback was specified at WebSocket
initialization, this function will never return messages

Returns a future whose result is the message, or None
if the connection is closed.  If a callback argument
is given it will be called with the future when it is
ready.
)rÏ  r·   rh  ri  rþ  ra  )r5   ra  Ú	awaitables   && r-   Úread_messageÚ&WebSocketClientConnection.read_message  sA   € ð —O‘O×'Ñ'Ó)ˆ	ØÒØ�L‰L×#Ñ#¤G×$9Ò$9¸)Ó$DÀhÔOØÐr0   c                óZ   <€ V ^8„  d   QhRS[ S[S[3,          RS[S[R,          ,          /# rø   rù   )r+   r,   s   "€r-   r.   rÄ  %  s-   ø€ ÷ )ñ )¡%©©U¨
Õ"3ð )¹ÁÈ4ÅÕ8Qñ )r0   c                ó$   € V P                  V4      # r2   )rê  r`   s   &&r-   ra   Ú$WebSocketClientConnection.on_message%  s   € Ø×Ñ Ó(Ð(r0   c                ó\   <€ V ^8„  d   QhRS[ RS[S[3,          RS[S[R,          ,          /# )r&   r^   Nr(   rù   )r+   r,   s   "€r-   r.   rÄ  (  s2   ø€ ÷ 0ñ 0Ù˜T¡3©Ð-Õ.ð0á	‘)˜D•/Õ	"ñ0r0   c                ó‚   € V P                   '       d   V P                  V4       R # V P                  P                  V4      # r2   )rÐ  rÏ  Úputr`   s   &&r-   rê  Ú%WebSocketClientConnection._on_message(  s6   € ð ×$×$Ð$Ø×%Ñ% gÔ.Ùà—?‘?×&Ñ& wÓ/Ð/r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   rÄ  1  s   ø€ ÷ 'ñ '™ð '¨ñ 'r0   c                ó‚   € \        V4      pV P                  f   \        4       hV P                  P                  V4       R# )a_  Send ping frame to the remote end.

The data argument allows a small amount of data (up to 125
bytes) to be sent as a part of the ping message. Note that not
all websocket implementations expose this data to
applications.

Consider using the ``ping_interval`` argument to
`websocket_connect` instead of sending pings manually.

.. versionadded:: 5.1

N)r   rÝ  r|   r  r4   s   &&r-   r  ÚWebSocketClientConnection.ping1  s2   € ô �D‹zˆØ�=‰=Ò Ü&Ó(Ð(Ø�‰× Ñ  Ö&r0   c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   rÄ  D  ó   ø€ ÷ ñ ™Eð  dñ r0   c                ó   € R # r2   r3   r4   s   &&r-   rk   Ú!WebSocketClientConnection.on_pongD  ó   € Ùr0   c                ó$   <€ V ^8„  d   QhRS[ RR/# rd   r)   )r+   r,   s   "€r-   r.   rÄ  G  r  r0   c                ó   € R # r2   r3   r4   s   &&r-   rg   Ú!WebSocketClientConnection.on_pingG  r  r0   c                ó    <€ V ^8„  d   QhRS[ /# rÆ   )r:  )r+   r,   s   "€r-   r.   rÄ  J  s   ø€ ÷ Qñ QÑ(9ñ Qr0   c                ó2   € \        V R V P                  R7      # )T)rÝ  rA  )r?  rA  rÌ   s   &r-   r¾   Ú0WebSocketClientConnection.get_websocket_protocolJ  s   € Ü" 4°tÀDÇKÁKÔPÐPr0   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# rÆ   rë   )r+   r,   s   "€r-   r.   rÄ  N  s   ø€ ÷ 2ñ 2¡h©s¥mñ 2r0   c                ó.   € V P                   P                  # )z?The subprotocol selected by the server.

.. versionadded:: 5.1
)rÝ  rí   rÌ   s   &r-   rí   Ú.WebSocketClientConnection.selected_subprotocolM  s   € ð �}‰}×1Ñ1Ð1r0   c                óN   <€ V ^8„  d   QhRRRS[ S[,          RS[ S[,          RR/# )r&   rn   zOptional[Type[BaseException]]ro   rp   r(   N)r   rq   r    )r+   r,   s   "€r-   r.   rÄ  U  sC   ø€ ÷ Qñ Qà,ðQñ ™Õ&ðQñ ‘]Õ#ð	Qð
 
ñQr0   c                óR   € Vf   Q hVf   Q h\         P                  ! RW!W#3R7       R # )NzUncaught exception %srû  )r   ró  rs   s   &&&&r-   rt   Ú'WebSocketClientConnection.log_exceptionU  s.   € ð ŠÐˆØÒ Ð Ð Ü�ŠÐ-¨uÀUÐ?O×Pr0   )rÐ  rû  rT   rU   rÎ  rý  r¶   r‘  rA  rÝ  rÏ  rÕ  rv   rN  r2   rO  )r@   rA   rB   rC   r}   rÝ  r�   r‹   rá  r  r)  r[   rÖ  rú  râ   r  ra   rê  r  rk   rg   r¾   rP  rí   rt   rD   rE   rQ  rR  s   @@r-   r¿  r¿  l  sï   ù‡ € ñð €Hð
 TXØ8<Ø)-Ø(,Ø 9Ø,0Ø'+÷<
õ <
÷|Qð Q÷!ò !÷ &ó &÷#ò #÷ð ÷Fó F÷<Cò C÷ ò ÷()ð )÷0ð 0÷'ò '÷&ð ÷ð ÷Qð Qð ÷2ó ð2÷Q÷ Qð Qr0   r¿  c                ó  € V ^8„  d   QhR\         \        \        P                  3,          R\        \
        R.R3,          ,          R\        \        ,          R\        \
        \         R\        \        3,          .R3,          ,          R\        \        \        \        3,          ,          R\        \        ,          R	\        \        ,          R
\        R\        \        \        ,          ,          R\        \        ,          RR/# )r&   rÑ  ra  z!Future[WebSocketClientConnection]NÚconnect_timeoutrÁ  r†   rƒ   r„   r…   ræ   rÂ  r(   z$Awaitable[WebSocketClientConnection])r   rW   r	   rÃ  r   r   r‡   r*   r   r   r<   r   r   )r+   s   "r-   r.   r.   `  së   € ÷ ]ñ ]Ü	Œs”J×*Ñ*Ð*Õ	+ð]ä”xÐ!DÐ EÀtÐ KÕLÕMð]ô œe•_ð]ô "¤(¬E°$¼¼UÐ2BÕ,CÐ+DÀdÐ+JÕ"KÕLð	]ô
 "¤$¤s¬C x¥.Õ1ð]ô œE•?ð]ô œ5•/ð]ô ð]ô œ4¤�9Õ%ð]ô ”xÕ ð]ð ,ñ]r0   c
                ó8  € \        V \        P                  4      '       d/   Ve   Q hT p
\        P                  ! V
P
                  4      V
n        M\        P                  ! WR7      p
\        \        P                  \        P                  ! V
\        P                  P                  4      4      p
\        V
VVVVVVV	R7      pVeM   \        P                  ! R\        ^R7       \        P                  ! 4       P                  VP                   V4       VP                   # )a³  Client-side websocket support.

Takes a url and returns a Future whose result is a
`WebSocketClientConnection`.

``compression_options`` is interpreted in the same way as the
return value of `.WebSocketHandler.get_compression_options`.

The connection supports two styles of operation. In the coroutine
style, the application typically calls
`~.WebSocketClientConnection.read_message` in a loop::

    conn = yield websocket_connect(url)
    while True:
        msg = yield conn.read_message()
        if msg is None: break
        # Do something with msg

In the callback style, pass an ``on_message_callback`` to
``websocket_connect``. In both styles, a message of ``None``
indicates that the connection has been closed.

``subprotocols`` may be a list of strings specifying proposed
subprotocols. The selected protocol may be found on the
``selected_subprotocol`` attribute of the connection object
when the connection is complete.

.. versionchanged:: 3.2
   Also accepts ``HTTPRequest`` objects in place of urls.

.. versionchanged:: 4.1
   Added ``compression_options`` and ``on_message_callback``.

.. versionchanged:: 4.5
   Added the ``ping_interval``, ``ping_timeout``, and ``max_message_size``
   arguments, which have the same meaning as in `WebSocketHandler`.

.. versionchanged:: 5.0
   The ``io_loop`` argument (deprecated since version 4.1) has been removed.

.. versionchanged:: 5.1
   Added the ``subprotocols`` argument.

.. versionchanged:: 6.3
   Added the ``resolver`` argument.

.. deprecated:: 6.5
   The ``callback`` argument is deprecated and will be removed in Tornado 7.0.
   Use the returned Future instead. Note that ``on_message_callback`` is not
   deprecated and may still be used.
)r#  )rÁ  r†   rƒ   r„   r…   ræ   rÂ  zZThe callback argument to websocket_connect is deprecated. Use the returned Future instead.)Ú
stacklevel)rÞ   r	   rÃ  r
   r“  r¶   r   Ú_RequestProxyÚ	_DEFAULTSr¿  rÞ  rß  ÚDeprecationWarningr   r¶  ri  rÎ  )rÑ  ra  r#  rÁ  r†   rƒ   r„   r…   ræ   rÂ  r’   Úconns   &&&&&&&&&&  r-   Úwebsocket_connectr*  `  sî   € ô~ �#”z×-Ñ-×.Ò.ØÒ&Ð&Ð&Øˆô #×.Ò.¨w¯©Ó?ˆ�ä×(Ò(¨ÔNˆÜÜ×ÑÜ× Ò  ¬*×*@Ñ*@×*JÑ*JÓKó€Gô %ØØ/Ø/Ø#Ø!Ø)Ø!Øô	€Dð ÒÜ�Šð/äØõ		
ô 	�ŠÓ×#Ñ# D×$7Ñ$7¸ÔBØ×ÑÐr0   i    )Rr}   r¥  rþ  r  Ú	functoolsr  r¢  rO  rk  rM  r”   Úurllib.parser   rÞ  r²  Útornado.concurrentr   r   Útornado.escaper   r   r   r   r	   r
   Útornado.ioloopr   Útornado.iostreamr   r   Útornado.logr   r   Útornado.netutilr   r   Útornado.queuesr   Útornado.tcpclientr   Útornado.utilr   Útypingr   r   r   r   r   r   r   r   r   r   r   Útypesr    Útyping_extensionsr!   r#   rH   rQ   r�   Ú	lru_cacheÚlogr¡  rj  rx   r|   r   r�   r•   ÚRequestHandlerr�   rI  ÚABCr:  r¨  rË  r?  Ú_HTTPConnectionr¿  r*  r3   r0   r-   Ú<module>r>     sƒ  ðñó Û Û Û Û Û Û 	Û 
Û Û Ý !Û Û ç Iß 7Ñ 7ß -Ñ -Ý !ß 8ß (Ý $Ý %Ý  Ý 'Ý (÷÷ ÷ ñ õ  çÝ*ô�hô ô˜ô ô˜Xô ð6 -Ð ð ×%Ò% g§k¡kÓ2€ô	�Yô 	ô	˜>ô 	ô	˜yô 	÷7ñ 7ôq�w—{‘{×1Ñ1ô qõh?ôX$˜Ÿ™ô X$÷v-ñ -÷`#ñ #ôLwÐ+ô wôtqQÐ 1× AÑ Aô qQðl QUØ'+ØOSØ48Ø%)Ø$(Ø5Ø(,Ø#'÷]ñ ]r0   