
    wg\jr                     &   S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
  SSKJr  SSKJr   SSKr " S S\R&                  5      r " S	 S
\R*                  5      r " S S5      rg! \ a    SSKr\R$                  " S5        Sr NUf = f)al  
Python WebSocket library
Copyright 2011 Joel Martin
Copyright 2016 Pierre Ossman
Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)

Supports following protocol versions:
    - http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07
    - http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10
    - http://tools.ietf.org/html/rfc6455
    N)	b64encode)sha1)urlparsez/no 'numpy' module, HyBi protocol will be slowerc                       \ rS rSrSrg)WebSocketWantReadError"    N__name__
__module____qualname____firstlineno____static_attributes__r	       O/home/edenadmin/noVNC/venv/lib/python3.13/site-packages/websockify/websocket.pyr   r   "       r   r   c                       \ rS rSrSrg)WebSocketWantWriteError$   r	   Nr
   r	   r   r   r   r   $   r   r   r   c                       \ rS rSrSrSrS rS rS/ 4S jrS r	S	 r
S
 rS rS rS rS rS rS rS rS rS rS rS&S jrS&S jrS'S jrS'S jrS rS rS rS rS rS rS r S  r!S! r"S" r#S(S# jr$S$ r%S%r&g))	WebSocket'   a  WebSocket protocol socket like class.

This provides access to the WebSocket protocol by behaving much
like a real socket would. It shares many similarities with
ssl.SSLSocket.

The WebSocket protocols requires extra data to be sent and received
compared to the application level data. This means that a socket
that is ready to be read may not hold enough data to decode any
application data, and a socket that is ready to be written to may
not have enough space for an entire WebSocket frame. This is
handled by the exceptions WebSocketWantReadError and
WebSocketWantWriteError. When these are raised the caller must wait
for the socket to become ready again and call the relevant function
again.

A connection is established by using either connect() or accept(),
depending on if a client or server session is desired. See the
respective functions for details.

The following methods are passed on to the underlying socket:

    - fileno
    - getpeername, getsockname
    - getsockopt, setsockopt
    - gettimeout, settimeout
    - setblocking
z$258EAFA5-E914-47DA-95CA-C5AB0DC85B11c                     SU l         SU l        SU l        / U l        SU l        SU l        SU l        SU l        SU l        SU l	        SU l
        g)z Creates an unconnected WebSocketnewr   NF)_state_partial_msg_recv_buffer_recv_queue_send_buffer_previous_sendmsg_sent_close_received_close
close_codeclose_reasonsocketselfs    r   __init__WebSocket.__init__G   sY     !% $ r   c                     US;   a%  U R                   c   e[        U R                   U5      $ [        U R                  R                  < SU< S35      e)N)filenogetpeernamegetsockname
getsockopt
setsockopt
gettimeout
settimeoutsetblockingz instance has no attribute '')r%   getattrAttributeError	__class__r   )r'   names     r   __getattr__WebSocket.__getattr__\   sV     # #
 ;;***4;;-- "&.."9"94"A B Br   Nc                 
   SU l         [        U5      nUR                  nUR                  S;   a
  U(       d  SnO2UR                  S;   a
  U(       d  SnO[	        SUR                  -  5      eU R
                  S:X  a  [        R                  " UR                  U45      U l        UR                  S;   aF  [        R                  " 5       nUR                  U R                  UR                  S9U l        S	U l        OS
U l        U R
                  S	:X  a!  U R                  R                  5         S
U l        U R
                  S
:X  Gat  SU l        [        S5       H5  nU =R                  [        [         R"                  " S5      5      -  sl        M7     [%        U R                  R'                  S5      5      R)                  S5      U l        UR*                  nU(       d  SnU R-                  SU5        U R/                  SUR                  5        U R/                  SS5        U R/                  SS5        U R/                  SU R                  5        U R/                  SS5        Ub  U R/                  SU5        [1        U5      S:  a!  U R/                  SSR3                  U5      5        U R5                  5         SU l        U R
                  S:X  a  U R7                  5         S U l        U R
                  S :X  GaP  U R9                  5       (       d  [	        S!5      eU R:                  R=                  S"5      S#:X  a  [>        eU R:                  RA                  S$S%5      u  ol        UR)                  S5      nURA                  5       n	[1        U	5      S&:  d	  U	S   S':w  a  [	        S(5      eU	S%   S):w  a   [	        S*S+R3                  U	S%S 5      -  5      eU R:                  RA                  S"S%5      u  ol        U
R)                  S5      S,-   n
[B        RD                  " U
5      n
U
RG                  SS5      RI                  5       S:w  a  [K        [M        U
5      5        [	        S-5      eU
RG                  S.5      nUc  [	        S/5      e[O        U R                  U RP                  -   R'                  S5      5      RS                  5       n[%        U5      R)                  S5      nU ?X:w  a  [	        S05      eU
RG                  S5      U l*        [1        U5      S:X  a  U RT                  b  [	        S15      eOU RT                  U;  a  [	        S25      eS3U l        g[	        S45      e)5a*  Establishes a new connection to a WebSocket server.

This method connects to the host specified by uri and
negotiates a WebSocket connection. origin should be specified
in accordance with RFC 6454 if known. A list of valid
sub-protocols can be specified in the protocols argument.

The data will be sent in the clear if the "ws" scheme is used,
and encrypted if the "wss" scheme is used.

Both WebSocketWantReadError and WebSocketWantWriteError can be
raised whilst negotiating the connection. Repeated calls to
connect() must retain the same arguments.
T)wshttpP   )wsshttpsi  zUnknown scheme '%s'r   )server_hostnamessl_handshakeheaders       latin-1ascii/GETHostUpgrade	websocket
ConnectionupgradeSec-WebSocket-KeySec-WebSocket-Version   NOriginr   Sec-WebSocket-Protocolz, send_headersresponsezSocket closed unexpectedlys   

s   
      zHTTP/1.1zInvalid response101zWebSocket request denied: %s 
#Missing or incorrect upgrade headerSec-WebSocket-Acceptz#Missing Sec-WebSocket-Accept headerz#Invalid Sec-WebSocket-Accept headerz(Unexpected Sec-WebSocket-Protocol headerz!Invalid protocol chosen by serverdone WebSocket is in an invalid state)+clientr   portscheme	Exceptionr   r%   create_connectionhostnamesslcreate_default_contextwrap_socketdo_handshake_keyrangechrrandom	randranger   encodedecodepathsend_requestsend_headerlenjoinend_headers_flush_recvr   findr   splitemailmessage_from_stringgetlowerprinttyper   GUIDdigestprotocol)r'   uriorigin	protocolsra   contextirq   requestwordsrB   acceptexpecteds                r   connectWebSocket.connecti   s`     smxx::'ZZ++1CJJ>??
 ;;% 22CLL$3GHDKzz--446%11$++BE,, 2 P-';;/)KK$$&#DK;;)#DI2Y		S!1!1#!677	 !$))"2"29"=>EEgNDI88DeT*VS\\2Y4\950$))<4b9!  629~!  !9499Y;OP(DK;;.(KKM$DK;;*$::<< <==  %%k2b8,,+/+<+<+B+B7A+N(W'nnY/GMMOEE
QE!H
$: 233Qx5  >%PQPR)AT TUU+/+<+<+B+B;PQ+R(W'nnY/&8G//8G{{9b)//1[@d7m$ EFF[[!78F~ EFFTYY2::7CDKKMH *11':H	! EFF#KK(@ADM9~"==,#$NOO - ==	1#$GHH DK:;;r   c                 B   U R                   S:X  Ga  SU l        Xl        UR                  SS5      R	                  5       S:w  a  [        S5      eUR                  S5      nUc  [        S	5      eUS
;   a  S[        U5      -  U l        O[        SU-  5      eUR                  S5      nUc  [        S5      e[        X@R                  -   R                  S5      5      R                  5       n[        U5      R                  S5      nSU l        UR                  SS5      R                  S5      nU(       a1  U R!                  U5      U l        U R                  U;  a  [        S5      eU R#                  SS5        U R%                  SS5        U R%                  SS5        U R%                  SU5        U R                  (       a  U R%                  SU R                  5        U R'                  5         SU l         U R                   S:X  a  U R)                  5         SU l         g[        S5      e)a  Establishes a new WebSocket session with a client.

This method negotiates a WebSocket connection with an incoming
client. The caller must provide the client socket and the
headers from the HTTP request.

A server can identify that a client is requesting a WebSocket
connection by looking at the "Upgrade" header. It will include
the value "websocket" in such cases.

WebSocketWantWriteError can be raised if the response cannot be
sent right away. accept() must be called again once more space
is available using the same arguments.
r   FrN   rC   rL   r\   rP   Nz$Missing Sec-WebSocket-Version header)7813z	hybi-%02dzUnsupported protocol version %srO   z Missing Sec-WebSocket-Key headerrG   rS   ,zInvalid protocol selectede   zSwitching ProtocolsrK   rM   r]   flushr^   r_   )r   r`   r%   r}   r~   rc   intversionr   r   ro   r   r   rp   r   rz   select_subprotocolsend_responsers   rv   rw   )r'   r%   rB   verkeyr   r   s          r   r   WebSocket.accept   s   & ;;%DK K{{9b)//1[@ EFF++56C{ FGG
 &&*SX5 AC GHH++12C{ BCC 3?227;<CCEFv&--g6FDM$<bAGGLI $ 7 7	 B ==	1#$?@@s$9:Y4\953V<}}  !94==I!DK;;'!KKM DK:;;r   c                     g)zReturns which sub-protocol should be used.

This method does not select any sub-protocol by default and is
meant to be overridden by an implementation that wishes to make
use of sub-protocols. It will be called during handling of
accept().
rC   r	   )r'   r   s     r   r   WebSocket.select_subprotocol4  s     r   c                 &    U R                  U5        g)zCalled when a WebSocket ping message is received.

This will be called whilst processing recv()/recvmsg(). The
default implementation sends a pong reply back.N)pongr'   datas     r   handle_pingWebSocket.handle_ping>  s    
 			$r   c                     g)zCalled when a WebSocket pong message is received.

This will be called whilst processing recv()/recvmsg(). The
default implementation does nothing.Nr	   r   s     r   handle_pongWebSocket.handle_pongE  s    
 	r   c                 "    U R                  5       $ )aY  Read data from the WebSocket.

This will return any available data on the socket (which may
be the empty string if the peer sent an empty message or
messages). If the socket is closed then None will be
returned. The reason for the close is found in the
'close_code' and 'close_reason' properties.

Unlike recvmsg() this method may return data from more than one
WebSocket message. It is however not guaranteed to return all
buffered data. Callers should continue calling recv() whilst
pending() returns True.

Both WebSocketWantReadError and WebSocketWantWriteError can be
raised when calling recv().
)recvmsgr&   s    r   recvWebSocket.recvL  s    " ||~r   c                     U R                   (       a  U R                  5         gU R                  5       (       a  U R                  5       $ U R	                  5       (       d  gU R                  5       $ )a2  Read a single message from the WebSocket.

This will return a single WebSocket message from the socket
(which will be the empty string if the peer sent an empty
message). If the socket is closed then None will be
returned. The reason for the close is found in the
'close_code' and 'close_reason' properties.

Unlike recv() this method will not return data from more than
one WebSocket message. Callers should continue calling
recvmsg() whilst pending() returns True.

Both WebSocketWantReadError and WebSocketWantWriteError can be
raised when calling recvmsg().
N)r"   rw   pending_recvmsg_recv_framesr&   s    r   r   WebSocket.recvmsg_  sT    " KKM <<>>==?"   "" }}r   c                 2    [        U R                  5      S:  $ )a  Check if any WebSocket data is pending.

This method will return True as long as there are WebSocket
frames that have yet been processed. A single recv() from the
underlying socket may return multiple WebSocket frames and it
is therefore important that a caller continues calling recv()
or recvmsg() as long as pending() returns True.

Note that this function merely tells if there are raw WebSocket
frames pending. Those frames may not contain any application
data.
r   )rt   r   r&   s    r   r   WebSocket.pending  s     4##$q((r   c                 D    [        U5      S:X  a  gU R                  U5      $ )a  Write data to the WebSocket

This will queue the given data and attempt to send it to the
peer. Unlike sendmsg() this method might coalesce the data with
data from other calls, or split it over multiple messages.

WebSocketWantWriteError can be raised if there is insufficient
space in the underlying socket. send() must be called again
once more space is available using the same arguments.
r   )rt   sendmsg)r'   bytess     r   sendWebSocket.send  s!     u:?||E""r   c                 L   [        U[        5      (       d  [        eU R                  (       a  gU R                  b8  U R                  U:w  a  [
        eU R                  5         SU l        [        U5      $  U R                  SU5        [        U5      $ ! [         a    Xl        e f = f)au  Write a single message to the WebSocket

This will queue the given message and attempt to send it to the
peer. Unlike send() this method will preserve the data as a
single WebSocket message.

WebSocketWantWriteError can be raised if there is insufficient
space in the underlying socket. sendmsg() must be called again
once more space is available using the same arguments.
r   NrX   )

isinstancer   	TypeErrorr!   r    
ValueErrorrw   rt   _sendmsgr   )r'   msgs     r   r   WebSocket.sendmsg  s     #u%%O!!-%%,  KKM%)D"s8O	MM#s#
 3x	 ' 	%("	s   4B B#c                 .    U R                  SX4-  5        g )NzHTTP/1.1 %d %s

_queue_str)r'   codemessages      r   r   WebSocket.send_response  s    ,>?r   c                 6    U R                  U< SU< S35        g )Nz: r[   r   )r'   keywordvalues      r   rs   WebSocket.send_header  s    78r   c                 &    U R                  S5        g )Nr[   r   r&   s    r   rv   WebSocket.end_headers  s    r   c                 R    U R                  UR                  5       < SU< S35        g )NrZ   z HTTP/1.1
)r   upper)r'   r   rq   s      r   rr   WebSocket.send_request  s    

dCDr   c                     [        U[        5      (       d  [        eU R                  b.  U R                  U:w  a  [        eU R                  5         SU l        g U R                  SU5        g! [         a    Xl        e f = f)zWrite a ping message to the WebSocket

WebSocketWantWriteError can be raised if there is insufficient
space in the underlying socket. ping() must be called again once
more space is available using the same arguments.
N	   r   r   r   r    r   rw   r   r   r   s     r   pingWebSocket.ping  u     $&&O!!-%%-  KKM%)D"	MM#t$& 	%)"	   A+ +A=c                     [        U[        5      (       d  [        eU R                  b.  U R                  U:w  a  [        eU R                  5         SU l        g U R                  SU5        g! [         a    Xl        e f = f)zWrite a pong message to the WebSocket

WebSocketWantWriteError can be raised if there is insufficient
space in the underlying socket. pong() must be called again once
more space is available using the same arguments.
N
   r   r   s     r   r   WebSocket.pong  r   r   c                 "   U R                   (       a  U R                  5         gU R                  (       d  SU l        SU l        SU l         SnUb0  U[
        R                  " SU5      -  nUb  XCR                  S5      -  nU R                  SU5        g)	a  Gracefully terminate the WebSocket connection.

This will start the process to terminate the WebSocket
connection. The caller must continue to calling recv() or
recvmsg() after this function in order to wait for the peer to
acknowledge the close. Calls to send() and sendmsg() will be
ignored.

WebSocketWantWriteError can be raised if there is insufficient
space in the underlying socket for the close message. shutdown()
must be called again once more space is available using the same
arguments.

The how argument is currently ignored.
N  zLocally initiated closeTr   >HUTF-8   )	r!   rw   r"   r#   r$   structpackro   r   )r'   howr   reasonr   s        r   shutdownWebSocket.shutdown  s    $ KKM ##"DO 9D6;;tT**C!}}W--c3r   c                 d    U R                  [        R                  X5        U R                  5         g)aX  Terminate the WebSocket connection immediately.

This will close the WebSocket connection directly after sending
a close message to the peer.

WebSocketWantWriteError can be raised if there is insufficient
space in the underlying socket for the close message. close()
must be called again once more space is available using the same
arguments.
N)r   r%   	SHUT_RDWR_close)r'   r   r   s      r   closeWebSocket.close'  s!     	f&&5r   c                    U R                   c   e  U R                   R                  S5      n[        U5      S:X  a  gU =R                  U-  sl        [        U R                   S5      (       a"  U R                   R                  5       (       d   gO gM  ! [         a*  nUR                  [        R                  :X  a  [
        ee S nAff = f)NTi   r   Fr   )
r%   r   OSErrorerrnoEWOULDBLOCKr   rt   r   hasattrr   )r'   r   excs      r   rx   WebSocket._recv5  s    {{&&&{{''- 4yA~% t{{I..{{**,,  - )   99 1 1100s   B 
C%CCc                 J   U R                  5       (       d:  U R                  c  SU l        SU l        S=U l        U l        U R                  5         g U R                  U R                  5      nUc   gU R                  US   S  U l        U R                  R                  U5        MT  )Ni  zConnection closed abnormallyTFlength)
rx   r#   r$   r!   r"   r   _decode_hybir   r   append)r'   frames     r   r   WebSocket._recv_framesO  s    zz||&"&$B!:>> 4#7KKM%%d&7&78E}  !% 1 1%/2B CD##E* r   c                 x   U R                   (       Gap  U R                   R                  S5      nU R                  (       d-  US   (       d#  U R                  [        R
                  SS5        Mk  U R                  (       a-  US   (       a#  U R                  [        R
                  SS5        M  US   S:X  am  U R                  (       d#  U R                  [        R
                  SS5        M  U =R                  US   -  sl        US	   (       a  U R                  nS
U l        U$ GOOUS   S:X  a#  U R                  [        R
                  SS5        GO#US   S:X  aP  U R                  (       a$  U R                  [        R
                  SS5        GM  US	   (       a  US   $ US   U l        GOUS   S:X  Ga  U R                  (       a  GM  SU l        U R                  (       a  U R                  5         g US	   (       d$  U R                  [        R
                  SS5        GM  S nS n[        US   5      S:  aL  [        R                  " SUS   S S 5      S   n[        US   5      S:  a  US   SS  n UR                  S5      nUc  SU l        SU l        OX0l        Ub  X@l        U R                  S X45        g US   S:X  aC  US	   (       d$  U R                  [        R
                  SS5        GM  U R#                  US   5        OsUS   S:X  aC  US	   (       d$  U R                  [        R
                  SS5        GM2  U R%                  US   5        O'U R                  [        R
                  SSUS   -  5        U R                   (       a  GMp  [&        e! [         a&    U R                  [        R
                  SS5         GM  f = f)Nr   maskedi  z Procotol error: Frame not maskedzProcotol error: Frame maskedopcodez-Procotol error: Unexpected continuation framepayloadfinr   rW   i  z*Unsupported: Text frames are not supportedrX   z$Procotol error: Unexpected new framer   TzUnsupported: Fragmented closer   r   z&Procotol error: Invalid UTF-8 in closei  z&No close status code specified by peerr   zUnsupported: Fragmented pingr   zUnsupported: Fragmented pongz"Unsupported: Unknown opcode 0x%02x)r   popr`   r   r%   r   r   r"   r!   r   rt   r   unpackrp   UnicodeDecodeErrorr#   r$   r   r   r   )r'   r   r   r   r   s        r   r   WebSocket._recvmsgb  s5   $$((+E;;uXf..6XY{{uXf..6TUX#%((MM&"2"2D:ij!!U9%55!<++C(+D%J   xC'f..6bcxC'$$MM&"2"2D:`a< ++(-i(8D%xC''''+$##KKMU|MM&"2"2D:YZuY'(A-!==uY/?/CDQGD5+,q0!&y!1!"!5%%+]]7%;F
 <&*DO(PD%&*O),2)dD1xC'U|MM&"2"2D:XY  y!12xC'U|MM&"2"2D:XY  y!12f..6Z]bck]l6lmc f %$;  2 % MM&*:*:DBjk$%s   +N	 	+N98N9c                    U R                   (       d  g U R                  c   e U R                  R                  U R                   5      nU R                   US  U l         U R                   (       a  [        eU R                  (       a#  U R                  (       a  U R                  5         g g g ! [         a*  nUR                  [        R
                  :X  a  [        ee S nAff = fN)
r   r%   r   r   r   r   r   r"   r!   r   )r'   sentr   s      r   rw   WebSocket._flush  s      {{&&&	;;##D$5$56D !--de4)) D$4$4KKM %5  	yyE-----	s   %B( (
C2%CCc                 N    U =R                   U-  sl         U R                  5         g r   )r   rw   r   s     r   _sendWebSocket._send  s    T!r   c                 L    U =R                   UR                  S5      -  sl         g )NrF   )r   ro   )r'   strings     r   r   WebSocket._queue_str  s     	V]]955r   c                    U R                   (       aN  Sn[        S5       H*  nU[        R                  " S5      R	                  5       -  nM,     U R                  XU5      nOU R                  X5      nU R                  U5      $ )Nr      rE   )r`   rk   rm   rn   to_bytes_encode_hybir  )r'   r   r   maskr   r   s         r   r   WebSocket._sendmsg  sk    ;;D1X((-6688 %%f48E%%f2Ezz%  r   c                 F    U R                   R                  5         S U l         g r   )r%   r   r&   s    r   r   WebSocket._close  s    r   c                 $    U R                  X5      $ r   )_unmask)r'   bufr  s      r   _maskWebSocket._mask  s    ||C&&r   c                    [         (       GaP  [        U5      nSnUnS=pgUS:  a  [         R                  " S5      n[        R                  S:X  a  UR                  S5      n[         R                  " X(SS9n[         R                  " X[        US-  5      S9n	[         R                  " X5      R                  5       nUS-  (       a  [         R                  " S	5      n[        R                  S:X  a  UR                  S5      n[         R                  " X(US-  S9n[         R                  " XX3S-  -
  US-  S
9n	[         R                  " X5      R                  5       nXg-   $ [        R                  " S	5      n	U	R                  U5        [        [        U	5      5       H  n
X==   X*S-     -  ss'   M     U	R                  5       $ )Nr   r   r	  z<u4big>rW   )countB)offsetr  )numpyrt   dtypesys	byteordernewbyteorder
frombufferr   bitwise_xortobytesarray	frombytesrk   )r'   r  r  plenpstartpendbcr  r   r   s              r   r  WebSocket._unmask  sn   5s8DFDKAqykk%(==E)!..s3E''1=''#dQh-H%%d199;axkk#&==E)!..s3E''D1HF''#ax0D%%d199;5L ;;s#DNN33t9%4A;& &<<>!r   c                 b   US-  nU(       a  US-  nSnUb  SnU R                  X#5      n[        U5      nUS::  a  [        R                  " SXWU-  5      nOKUS:  a#  US:  a  [        R                  " SUSU-  U5      nO"US:  a  [        R                  " S	US
U-  U5      nUb  WU-   U-   $ WU-   $ )zEncode a HyBi style WebSocket frame.
Optional opcode:
    0x0 - continuation
    0x1 - text frame
    0x2 - binary frame
    0x8 - connection close
    0x9 - ping
    0xA - pong
      r   }   >BBi   z>BBH~   z>BBQ   )r  rt   r   r   )	r'   r   r  mask_keyr   b1mask_bitpayload_lenheaders	            r   r  WebSocket._encode_hybi  s     d]$JBH**S+C#h#[[(,BCF3;#6[[S8^[IFE![[S8^[IFH$s**C<r   c                 (   SSSSSS.n[        U5      nSnX4:  a  g[        R                  " SUSS 5      u  pVUS-  US'   US	-  (       US
'   US	-  (       US'   US   (       a  US-  nX4:  a  gUS-  nUS:X  a(  US-  nX4:  a  g[        R                  " SUSS 5      u  nO-US:X  a'  US-  nX4:  a  g[        R                  " SUSS 5      u  nXG-   US'   X2S   :  a  gUS   (       a"  XS-
  U nU R                  XXG-    U5      US'   U$ XXG-    US'   U$ )zDecode HyBi style WebSocket packets.
Returns:
    {'fin'          : boolean,
     'opcode'       : number,
     'masked'       : boolean,
     'length'       : encoded_length,
     'payload'      : decoded_buffer}
r   FN)r   r   r   r   r   rX   r/  r,  r   r-  r   r   r	  r1  r0  r   r   z>Qr   r   r   )rt   r   r   r  )	r'   r  fblenhlenr3  b2r   r2  s	            r   r   WebSocket._decode_hybi2  s\     #"	$ 3x;uc"1g.4i(I%!Dy/(X;AID{dS=AID{mmD#a(3GFs]AID{mmD#a)4GFm(H+X;6$'H<<$+(?JAiL  T[2AiLr   )rj   r   r    r"   r   r   r   r!   r   r`   r#   r$   r   r%   r   )r   )r   N)NT)'r   r   r   r   __doc__r   r(   r8   r   r   r   r   r   r   r   r   r   r   r   rs   rv   rr   r   r   r   r   rx   r   r   rw   r  r   r   r   r  r  r  r   r   r	   r   r   r   r   '   s    : 2D*B #'" ~<@I<V&"H)#  D@9 E22# J4&U%n0
6

!
'"B B9r   r   )r>  r  r#  r{   r   rm   r%   rf   r   base64r   hashlibr   urllib.parser   r  ImportErrorwarningswarnSSLWantReadErrorr   SSLWantWriteErrorr   r   r	   r   r   <module>rG     s   
       
    !	S11 		c33 	D D  MMCDEs   A/ /BB