
    OjZw                       d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	Z
d dlmZmZmZ d dlmZ d dlmZmZmZmZ ddlmZmZmZ ddlmZmZ dd	lmZmZm Z m!Z!m"Z" dd
l#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5 ddlm6Z6m7Z7m8Z8m9Z9 ddl:m;Z;m<Z< ddl=m>Z> g dZ? e@ej                  j                  dd            ZC G d de>      ZD G d d      ZE	 	 d(	 	 	 	 	 	 	 d)dZF	 d dlGmHZH d dlIm0ZJ eHj                  eHj                  eHj                  eHj                  dZMd d!d d!dZN	 	 	 	 	 	 	 	 d*d"ZO G d$ d%ej                        ZRdd&	 	 	 	 	 	 	 	 	 d+d'ZSy# eP$ r 	 	 	 	 	 	 	 	 d*d#ZOY 9w xY w),    )annotationsN)AsyncIterator	GeneratorSequence)TracebackType)AnyCallableLiteralcast   )ClientProtocolbackoffprocess_exception)HeadersHeadersLike)InvalidProxyMessageInvalidProxyStatusInvalidStatus
ProxyErrorSecurityError)ClientExtensionFactory) enable_client_permessage_deflate)validate_subprotocols)
USER_AGENTResponse)
CONNECTINGEvent)Proxy	get_proxyparse_proxyprepare_connect_request)StreamReader)
LoggerLikeOriginPathLikeSubprotocol)WebSocketURI	parse_uri   )
Connection)connectunix_connectClientConnectionWEBSOCKETS_MAX_REDIRECTS10c                  p     e Zd ZdZdddddd	 	 	 	 	 	 	 	 	 	 	 	 	 d fdZdef	 	 	 	 	 dd	Zd fd
Z xZS )r-   a  
    :mod:`asyncio` implementation of a WebSocket client connection.

    :class:`ClientConnection` provides :meth:`recv` and :meth:`send` coroutines
    for receiving and sending messages.

    It supports asynchronous iteration to receive messages::

        async for message in websocket:
            await process(message)

    The iterator exits normally when the connection is closed with code
    1000 (OK) or 1001 (going away) or without a close code. It raises a
    :exc:`~websockets.exceptions.ConnectionClosedError` when the connection is
    closed with any other code.

    The ``ping_interval``, ``ping_timeout``, ``close_timeout``, ``max_queue``,
    and ``write_limit`` arguments have the same meaning as in :func:`connect`.

    Args:
        protocol: Sans-I/O connection.

       
         ping_intervalping_timeoutclose_timeout	max_queuewrite_limitc               r    |  t         |   ||||||       | j                  j                         | _        y )Nr5   )super__init__loopcreate_futureresponse_rcvd)selfprotocolr6   r7   r8   r9   r:   	__class__s          p/var/www/origus_pro_usr/data/www/origus.pro/core/.venv/lib/python3.12/site-packages/websockets/asyncio/client.pyr=   zClientConnection.__init__A   sC     	'%'# 	 	
 48993J3J3L    Nc                  K   | j                   j                         | _        |%| j                  j                  j	                  |       |&| j                  j                  j                  d|       | j                  t              4 d{    | j                   j                  | j                         ddd      d{    t        j                  | j                  | j                  gt        j                         d{    | j                   j                  | j                   j                  y7 7 v# 1 d{  7  sw Y   xY w7 Jw)z1
        Perform the opening handshake.

        Nz
User-Agent)expected_state)return_when)rB   r+   requestheadersupdate
setdefaultsend_contextr   send_requestasynciowaitr@   connection_lost_waiterFIRST_COMPLETEDhandshake_exc)rA   additional_headersuser_agent_headers      rD   	handshakezClientConnection.handshakeV   s     }},,.)LL  ''(:;(LL  ++L:KL$$J$? 	5 	5MM&&t||4	5 	5 ll!<!<=//
 	
 	
 ==&&2----- 3	5 	5 	5 	5 	5	
sU   B	ED5E&D95E D7AEE2E7E9E?E EEc                    | j                   5t        |t              sJ || _         | j                  j	                  d       yt
        |   |       y)z.
        Process one incoming event.

        N)response
isinstancer   r@   
set_resultr<   process_event)rA   eventrC   s     rD   r[   zClientConnection.process_events   sI     == eX...!DM))$/ G!%(rE   )rB   r   r6   float | Noner7   r]   r8   r]   r9   *int | None | tuple[int | None, int | None]r:   int | tuple[int, int | None]returnNone)rT   HeadersLike | NonerU   
str | Noner`   ra   )r\   r   r`   ra   )	__name__
__module____qualname____doc__r=   r   rV   r[   __classcell__)rC   s   @rD   r-   r-   (   s    8 ')%'&(@B49M M $	M
 #M $M >M 2M 
M. 26(2... &. 
	.:) )rE   r-   c                      e Zd ZdZdddddededdddeddd	ddd
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZddZ	ddZ
ddZddZ	 	 	 	 	 	 	 	 ddZddZy)r+   u'  
    Connect to the WebSocket server at ``uri``.

    :func:`connect` should be treated as an asynchronous context manager
    yielding a :class:`ClientConnection`, which can then receive and send
    messages::

        from websockets.asyncio.client import connect

        async with connect(...) as websocket:
            ...

    The connection is closed automatically when exiting the context.

    :func:`connect` can also be treated as an infinite asynchronous iterator
    to reconnect automatically on errors::

        async for websocket in connect(...):
            try:
                ...
            except websockets.exceptions.ConnectionClosed:
                continue

    If the connection fails with a transient error, it is retried with
    exponential backoff. If it fails with a fatal error, the exception is
    raised, breaking out of the loop.

    The connection is closed automatically after each iteration of the loop.

    :func:`connect` can be awaited directly::

        websocket = await connect(...)

    In that case, you're responsible for closing the connection with
    :meth:`ClientConnection.close` when no longer needed.

    Args:
        uri: URI of the WebSocket server.
        origin: Value of the ``Origin`` header, for servers that require it.
        extensions: List of supported extensions, in order in which they
            should be negotiated and run.
        subprotocols: List of supported subprotocols, in order of decreasing
            preference.
        compression: The "permessage-deflate" extension is enabled by default.
            Set ``compression`` to :obj:`None` to disable it. See the
            :doc:`compression guide <../../topics/compression>` for details.
        additional_headers: Arbitrary HTTP headers to add to the handshake
            request.
        user_agent_header: Value of  the ``User-Agent`` request header.
            It defaults to ``"Python/x.y.z websockets/X.Y"``.
            Setting it to :obj:`None` removes the header.
        proxy: If a proxy is configured, it is used by default. Set ``proxy``
            to :obj:`None` to disable the proxy or to the address of a proxy
            to override the system configuration. See the :doc:`proxy docs
            <../../topics/proxies>` for details.
        process_exception: When reconnecting automatically, tell whether an
            error is transient or fatal. The default behavior is defined by
            :func:`~websockets.client.process_exception`. Refer to its
            documentation for details.
        open_timeout: Timeout for opening the connection in seconds.
            :obj:`None` disables the timeout.
        ping_interval: Interval between keepalive pings in seconds.
            :obj:`None` disables keepalive.
        ping_timeout: Timeout for keepalive pings in seconds.
            :obj:`None` disables timeouts.
        close_timeout: Timeout for closing the connection in seconds.
            :obj:`None` disables the timeout.
        reconnect_delays: Delays in seconds between reconnection attempts.
            Default is exponential backoff with 5s jitter, capped at 60s.
        max_size: Maximum size of incoming messages in bytes.
            :obj:`None` disables the limit. You may pass a ``(max_message_size,
            max_fragment_size)`` tuple to set different limits for messages and
            fragments when you expect long messages sent in short fragments.
        max_queue: High-water mark of the buffer where frames are received.
            It defaults to 16 frames. The low-water mark defaults to ``max_queue
            // 4``. You may pass a ``(high, low)`` tuple to set the high-water
            and low-water marks. If you want to disable flow control entirely,
            you may set it to ``None``, although that's a bad idea.
        write_limit: High-water mark of write buffer in bytes. It is passed to
            :meth:`~asyncio.WriteTransport.set_write_buffer_limits`. It defaults
            to 32 KiB. You may pass a ``(high, low)`` tuple to set the
            high-water and low-water marks.
        logger: Logger for this client.
            It defaults to ``logging.getLogger("websockets.client")``.
            See the :doc:`logging guide <../../topics/logging>` for details.
        create_connection: Factory for the :class:`ClientConnection` managing
            the connection. Set it to a wrapper or a subclass to customize
            connection handling.

    Any other keyword arguments are passed to the event loop's
    :meth:`~asyncio.loop.create_connection` method.

    For example:

    * You can set ``sock`` to provide a preexisting TCP socket. You may call
      :func:`socket.create_connection` (not to be confused with the event loop's
      :meth:`~asyncio.loop.create_connection` method) to create a suitable
      client socket and customize it.

    * You can set ``ssl`` to a :class:`~ssl.SSLContext` to enforce TLS settings.
      When connecting to a ``wss://`` URI, if ``ssl`` isn't provided, a TLS
      context is created with :func:`~ssl.create_default_context`.

    * You can set ``server_hostname`` to override the host name from ``uri`` in
      the TLS handshake.

    * You can configure ``ssl_handshake_timeout`` and ``ssl_shutdown_timeout``.

    * You can set ``host`` and ``port`` to connect to a different host and port
      from those found in ``uri``. This only changes the destination of the TCP
      connection. The host name from ``uri`` is still used in the TLS handshake
      for secure connections and in the ``Host`` header.

    When using a proxy:

    * Prefix keyword arguments with ``proxy_`` for configuring TLS between the
      client and an HTTPS proxy: ``proxy_ssl``, ``proxy_server_hostname``,
      ``proxy_ssl_handshake_timeout``, and ``proxy_ssl_shutdown_timeout``.
    * Use the standard keyword arguments for configuring TLS between the proxy
      and the WebSocket server: ``ssl``, ``server_hostname``,
      ``ssl_handshake_timeout``, and ``ssl_shutdown_timeout``.
    * Other keyword arguments are used only for connecting to the proxy.

    Raises:
        InvalidURI: If ``uri`` isn't a valid WebSocket URI.
        InvalidProxy: If ``proxy`` isn't a valid proxy.
        OSError: If the TCP connection fails.
        InvalidHandshake: If the opening handshake fails.
        TimeoutError: If the opening handshake times out.

    NdeflateTr2   r1   i   r3   r4   )origin
extensionssubprotocolscompressionrT   rU   proxyr   open_timeoutr6   r7   r8   reconnect_delaysmax_sizer9   r:   loggercreate_connectionc                  || _         t        |      | _        | j                  j                  s|j	                  d      t        d      t               |dk(  rt              n|t        d|       t        j                  d      t        || _        || _        || _        |	| _        |
| _        || _        | _        || _        dfd}|| _        y )Nsslz-ssl argument is incompatible with a ws:// URIrj   zunsupported compression: zwebsockets.clientc                F    t        | 	      } |
      }|S )N)rk   rl   rm   rr   rs   r5   )r   )urirB   
connectionr8   rt   rl   rs   r9   rr   rk   r6   r7   rm   r:   s      rD   factoryz!connect.__init__.<locals>.factoryC  sE    %%)!H ++)+#'J rE   )rx   r'   r`   r-   )rx   r(   ws_urisecureget
ValueErrorr   r   logging	getLoggerr-   rT   rU   ro   r   rp   rq   rs   create_connection_kwargsrz   )rA   rx   rk   rl   rm   rn   rT   rU   ro   r   rp   r6   r7   r8   rq   rr   r9   r:   rs   rt   kwargsrz   s     ```      ``` `````  rD   r=   zconnect.__init__  s    > n{{!!fjj&7&CLMM#!,/)#9*EJ$8FGG>&&':;F$ 0"4!2
!2( 0(.%	 	, rE   c                ,   K   t        j                         } j                  j                         } j                  }|j                  dd      rd}|j                  d      d}|du rt         j                        }d fd} j                  j                  rT|j                  dd       |j                  d      t        d      |j                  d	 j                  j                         |j                  dd      r  |j                  |fi | d{   \  }}|S |t        |      }|j                  dd
 dk(  rRt!        | j                  |j                  dd             d{   } |j"                  |fd|i| d{   \  }}|S |j                  dd dk(  rW|i i }}
}	|	j%                         D ]@  \  }}|j'                  d      s|d	k(  r|||<   "|j'                  d      r	||
|dd <   <||
|<   B |j                  dk(  r.|
j                  dd       |
j                  d      't        d      |
j                  d      t        d      t)        | j                  fd j*                  i|
 d{   } |       }|j-                  |       |j                  dd      }|du rt/        j0                         }|# |j2                  |||fi | d{   }|J |}|j5                  |       |S t7        d      |j                  d      L|j                  d j                  j                         |j                  d j                  j8                          |j"                  |fi | d{   \  }}|S 7 n7 7 7 7 7 w)zFOpen a TCP or Unix connection to the server, possibly through a proxy.unixFNsockTc                 :     j                   j                        S N)rz   r{   rA   s   rD   rz   z,connect.open_tcp_connection.<locals>.factoryh  s    <<,,rE   rv   z*ssl=None is incompatible with a wss:// URIserver_hostname   socks
local_addr)r      httpproxy_   httpsz5proxy_ssl=None is incompatible with an https:// proxyz8proxy_ssl argument is incompatible with an http:// proxyrU   z&parse_proxy returned unsupported proxyhostportr`   r-   )rO   get_running_loopr   copyro   r}   r   r{   r|   rL   r~   r   popcreate_unix_connectionr    schemeconnect_socks_proxyrt   items
startswithconnect_http_proxyrU   set_protocol
ssl_modulecreate_default_context	start_tlsconnection_madeAssertionErrorr   )rA   r>   r   ro   rz   _ry   proxy_parsedr   
all_kwargsproxy_kwargskeyvalue	transportrv   new_transports   `               rD   open_tcp_connectionzconnect.open_tcp_connection[  s    '')..335

::fe$E::f)ED=dkk*E	- ;;eT*zz% ( !MNN/1A1AB::fe$"=$"="=g"P"PPMAz&u-L""2A&'10 KK%zz,=	  '=d&<&<'' ' !:
 "!$$Ra(F2392r&L
","2"2"4 2JC~~e,7H0H&+s105SW-,1S)2  &&'1 ++E48#''.6(S  $''.:(V  #5 KK# '+&<&<# #	# 	 %Y
&&z2jj-$;$;;=C?*8$..!:s+6<+ %M )444 -I**95!! %%MNN zz&!)!!&$++*:*:;!!&$++*:*:;"8$"8"8"KF"KKMAzY Q!<%" Lsp   DNNAN+N,NN
	C4N=N>A NNBN:N;
NN
NNNNc                   t        |t              r0|j                  j                  dv rd|j                  j                  v s|S | j
                  }t        j                  j                  | j                  |j                  j                  d         }t        |      }| j                  j                  d      t        d| d      S |j                  r|j                  st        d|       S |j                  |j                  k7  s2|j                   |j                   k7  s|j"                  |j"                  k7  r| j                  j                  dd      rt        d	| d
      S | j                  j                  d      | j                  j                  d      t        d	| d      S | j$                  8t'        d t'        | j$                        j)                         D              | _        |S )z
        Determine whether a connection error is a redirect that can be followed.

        Return the new URI if it's a valid redirect. Else, return an exception.

        ),  i-  i.  i/  i3  i4  Locationr   zcannot follow redirect to z with a preexisting socketz)cannot follow redirect to non-secure URI r   Fz'cannot follow cross-origin redirect to z with a Unix socketr   r   z with an explicit host or portc              3  N   K   | ]  \  }}|j                         d vr||f  yw))authorizationcookiezproxy-authorizationN)lower).0r   r   s      rD   	<genexpr>z+connect.process_redirect.<locals>.<genexpr>  s2      &C99;QR es   #%)rY   r   rX   status_coderJ   r{   urllibparseurljoinrx   r(   r   r}   r~   r|   r   r   r   rT   r   	raw_items)rA   exc
old_ws_urinew_uri
new_ws_uris        rD   process_redirectzconnect.process_redirect  s    sM*(( cll222J[[
,,&&txx1E1Ej1QRw'
 ((,,V4@,WI5OP 
 Z%6%6 #LWI!VWW !2!22*//1*//1 ,,00?!=gY G) *  --11&9E0044V<H!=gY G4 5  &&2*1*1$2I2I*J*T*T*V+' rE   c                0  K   	 t        j                  | j                        4 d {    t        t              D ]m  }| j                          d {   }	 |j                  | j                  | j                         d {    |j                          |c cd d d       d {    S  t'        dt         d      7 7 n7 A7 # t         j                  $ r |j                  j                           t        $ re}|j                  j                          | j                  |      }t        |t              r||u r |||| _        t#        |      | _        Y d }~!d }~ww xY w# 1 d {  7  sw Y   y xY w# t(        $ r}t)        d      |d }~ww xY ww)Nz
more than z
 redirectsz"timed out during opening handshake)rO   timeoutrp   rangeMAX_REDIRECTSr   rV   rT   rU   start_keepaliveCancelledErrorr   abort	Exceptionr   rY   rx   r(   r{   r   TimeoutError)rA   r   ry   r   
exc_or_uris        rD   r+   zconnect.connect  s    *	Nt'8'89 %P %P}- $PA'+'?'?'A!AJ *(22 33 22  < #224))G%P %P %P$PH (*]O:(NOOK%P!A	%P #11 ",,224$ % #,,224%)%:%:3%?
%j)<)S0 %&0c 9 (2DH*3J*?DK$)%%P %P %PN  	NCD#M	Ns   F#E9 B>E9 &E$C E$)C CCE$E9 $C%E9 )F*E$>E9  E$CE9 6E!<AEE$E!!E$$E6*E-+E62E9 5F6E9 9	FFFFc                >    | j                         j                         S r   )r+   	__await__r   s    rD   r   zconnect.__await__7  s    ||~''))rE   c                r   K   t        | d      rt        d      |  d {   | _        | j                  S 7 w)Nry   zconnect() isn't reentrant)hasattrRuntimeErrorry   r   s    rD   
__aenter__zconnect.__aenter__=  s4     4&:;; $* %s   757c                h   K   	 | j                   j                          d {    | ` y 7 # | ` w xY wwr   )ry   close)rA   exc_type	exc_value	tracebacks       rD   	__aexit__zconnect.__aexit__C  s1     	 //''))) *s    2+ )+ 2+ /2c                 K   d }	 	 | 4 d {   }| d d d       d {    d }$7 7 	# 1 d {  7  sw Y   xY w# t         $ r}	 | j                  |      }n# t         $ r}|}Y d }~nd }~ww xY w||u r ||||| j                         }t        |      }| j                  j                  d|t        j                  |      d   j                                t        j                  |       d {  7   Y d }~d }~ww xY ww)Nz0connect failed; reconnecting in %.1f seconds: %sr   )r   r   rq   nextrs   infor   format_exception_onlystriprO   sleep)rA   delaysry   r   new_exc
raised_excdelays          rD   	__aiter__zconnect.__aiter__P  s    *." % %:$$% %B G % % % % % +
)"44S9G  )(G)
 c>&!s* >!224FV  F33C8;AAC
 mmE***7+s   D
A *A .A ,A D
A A A 7A A 	DAD	A4(A/*D/A44BD7C:8D=D
DD
)*rx   strrk   zOrigin | Nonerl   z'Sequence[ClientExtensionFactory] | Nonerm   zSequence[Subprotocol] | Nonern   rc   rT   rb   rU   rc   ro   zstr | Literal[True] | Noner   z'Callable[[Exception], Exception | None]rp   r]   r6   r]   r7   r]   r8   r]   rq   zCallable[[], Generator[float]]rr   r^   r9   r^   r:   r_   rs   zLoggerLike | Nonert   ztype[ClientConnection] | Noner   r   r`   ra   r   )r   r   r`   zException | str)r`   z&Generator[Any, None, ClientConnection])r   ztype[BaseException] | Noner   zBaseException | Noner   zTracebackType | Noner`   ra   )r`   zAsyncIterator[ClientConnection])rd   re   rf   rg   r   r   r   r=   r   r   r+   r   r   r   r    rE   rD   r+   r+      s}   BR !%>B59"+15(2,0EV%'&(%'&(;B?D@B49$(;?7QQ
 Q <Q 3Q  Q /Q &Q *Q CQ #Q  $!Q" ##Q$ $%Q& 9'Q* =+Q, >-Q. 2/Q2 "3Q6 97Q: ;Q< 
=QfcJFP+N^*	 ,	  (	  (		 
 
	 %rE   r+   c                P    ||j                  d      d}nd}t        d|d| d|S )a  
    Connect to a WebSocket server listening on a Unix socket.

    This function accepts the same keyword arguments as :func:`connect`.

    It's only available on Unix.

    It's mainly useful for debugging servers listening on Unix sockets.

    Args:
        path: File system path to the Unix socket.
        uri: URI of the WebSocket server. ``uri`` defaults to
            ``ws://localhost/`` or, when a ``ssl`` argument is provided, to
            ``wss://localhost/``.

    rv   zws://localhost/zwss://localhost/T)rx   r   pathr   )r}   r+   )r   rx   r   s      rD   r,   r,   x  s9    * {::e$#C$C;sD;F;;rE   )	ProxyType)r   )socks5hsocks5socks4asocks4TFc           	     p  K   t        t        | j                     | j                  | j                  | j
                  | j                  t        | j                           }	  |j                  |j                  |j                  fi | d{   S 7 # t        $ r  t        $ r}t        d      |d}~ww xY ww)z0Connect via a SOCKS proxy and return the socket.Nz failed to connect to SOCKS proxy)
SocksProxySOCKS_PROXY_TYPESr   r   r   usernamepasswordSOCKS_PROXY_RDNSr+   OSErrorr   r   )ro   r{   r   socks_proxyr   s        rD   r   r     s      !ell+JJJJNNNNU\\*
	J,,,V[[&++PPPPP 	 	J?@cI	Js<   AB6+B 	B
B B6B B3"B..B33B6c                    K   t        d      w)Nz6connecting through a SOCKS proxy requires python-socks)ImportError)ro   r{   r   s      rD   r   r     s     
 RSSs   c                  J    e Zd Z	 d	 	 	 	 	 d	dZd
dZddZddZd
dZddZy)HTTPProxyConnectionNc                R   || _         || _        || _        t               | _        t        j                  | j                  j                  | j                  j                  | j                  j                  d      | _
        t        j                         }|j                         | _        y )NT)ro   )r{   ro   rU   r"   readerr   r   	read_line
read_exactread_to_eofparserrO   r   r?   rX   )rA   r{   ro   rU   r>   s        rD   r=   zHTTPProxyConnection.__init__  s}     
!2"nnnKK!!KK""KK##	
 '')262D2D2FrE   c                   	 t        | j                         y # t        $ rs}|j                  }d|j                  cxk  rdk  rn n| j
                  j                  |       n)| j
                  j                  t        |             Y d }~y Y d }~y d }~wt        $ r7}t        d      }||_        | j
                  j                  |       Y d }~y d }~ww xY w)N   r   z0did not receive a valid HTTP response from proxy)r   r   StopIterationr   r   rX   rZ   set_exceptionr   r   r   	__cause__)rA   r   rX   	proxy_excs       rD   
run_parserzHTTPProxyConnection.run_parser  s    	3 	JyyHh**0S0((2++,>x,HII 3  	3+BI #&IMM''	22	3s!    	CA$BC-CCc                    t        t        j                  |      }|| _        | j                  j	                  t        | j                  | j                  | j                               y r   )	r   rO   	Transportr   writer!   ro   r{   rU   )rA   r   s     rD   r   z#HTTPProxyConnection.connection_made  sG    **I6	"#DJJT=S=ST	
rE   c                Z    | j                   j                  |       | j                          y r   )r   	feed_datar  )rA   datas     rD   data_receivedz!HTTPProxyConnection.data_received  s    d#rE   c                X    | j                   j                          | j                          y r   r   feed_eofr  r   s    rD   eof_receivedz HTTPProxyConnection.eof_received      rE   c                X    | j                   j                          | j                          y r   r  )rA   r   s     rD   connection_lostz#HTTPProxyConnection.connection_lost  r  rE   r   )r{   r'   ro   r   rU   rc   )r`   ra   )r   zasyncio.BaseTransportr`   ra   )r  bytesr`   ra   )r   zException | Noner`   ra   )	rd   re   rf   r=   r  r   r	  r  r  r   rE   rD   r   r     sE    
 )-	GG G &	G*3 
rE   r   )rU   c               8   K    t        j                         j                   fd j                   j                  fi | d {   \  }}	 |j
                   d {    |S 7 7 # t         j                  t        f$ r |j                           w xY ww)Nc                     t               S r   )r   )ro   rU   r{   s   rD   <lambda>z$connect_http_proxy.<locals>.<lambda>  s    #FE3DE rE   )	rO   r   rt   r   r   rX   r   r   r   )ro   r{   rU   r   r   rB   s   ```   rD   r   r     s      !M 8 8 : L LE



! 	! Ix
  	 ""I. s<   AB	A(
BA, !A*"A, &B*A, ,+BB)NN)r   zPathLike | Nonerx   rc   r   r   r`   r+   )ro   r   r{   r'   r   r   r`   zsocket.socket)
ro   r   r{   r'   rU   rc   r   r   r`   zasyncio.Transport)T
__future__r   rO   r   ossocketrv   r   r   urllib.parser   collections.abcr   r   r   typesr   typingr   r	   r
   r   clientr   r   r   datastructuresr   r   
exceptionsr   r   r   r   r   extensions.baser   extensions.permessage_deflater   rJ   r   http11r   r   rB   r   r   ro   r   r   r    r!   streamsr"   r#   r$   r%   r&   rx   r'   r(   ry   r*   __all__intenvironr}   r   r-   r+   r,   python_socksr   python_socks.async_.asyncior   SOCKS5SOCKS4r   r   r   r   Protocolr   r   r   rE   rD   <module>r+     s   "   	     > >  / / ? ? 1  5 L + ) ( J J " > > ) " :BJJNN#=tDEW)z W)vr rl !<
<	< < 	<:2J&? ##""##""	 	JJJ J 
	J27'** 7| %)	 "	
  W  TTTT T 
	TTs   7E+ +E?>E?