§
    xÅj€   ã                  ó*  — 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
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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l0m1Z1m2Z2 ddl3m4Z4m5Z5m6Z6m7Z7 ddl8m9Z9 ddlm:Z:m;Z;m<Z<m=Z=m>Z> ddl?m@Z@mAZA ddlBmCZC ddlDmEZE g d¢ZF eGejH         I                    dd¦  «        ¦  «        ZJ G d„ deC¦  «        ZK G d„ d¦  «        ZLeddddddddddddddddddddddœdodF„¦   «         ZMedddddddddddddddddddddGœdpdI„¦   «         ZMdddddddJde.dKdddLdMdMdLdNdOddddœdqdR„ZM	 	 drdsdU„ZNe	 	 dtddVœdudW„¦   «         ZOe	 	 dtdvdX„¦   «         ZO	 	 drddVœdwdY„ZO	 d dZlPmQZQ d d[lRm4ZS eQjT        eQjT        eQjU        eQjU        d\œZVdKd]dKd]d\œZWdxdd„ZXn# eY$ r dxde„ZXY nw xY wdydg„ZZddddhœdzdi„Z[ edj¦  «        Z\ edkede\f         ¬l¦  «        Z] G dm„ dn¦  «        Z^dS ){é    )ÚannotationsN)Ú	GeneratorÚIteratorÚSequence)ÚTracebackType)ÚAnyÚCallableÚLiteralÚTypeVarÚcastÚoverloadé   )Ú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)Ú	BytesLikeÚ
LoggerLikeÚOriginÚPathLikeÚSubprotocol)ÚWebSocketURIÚ	parse_urié   )Ú
Connection)ÚDeadline)ÚconnectÚunix_connectÚ	reconnectÚunix_reconnectÚClientConnectionÚWEBSOCKETS_MAX_REDIRECTSÚ10c                  ól   ‡ — e Zd ZdZdddddœd ˆ fd„Zd!ˆ fd„Zd"d„Zdedfd#d„Zd$ˆ fd„Z	d"ˆ fd„Z
ˆ xZS )%r3   a+  
    :mod:`threading` implementation of a WebSocket client connection.

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

    It supports iteration to receive messages::

        for message in websocket:
            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``, and
    ``max_queue`` arguments have the same meaning as in :func:`connect`.

    Args:
        socket: Socket connected to a WebSocket server.
        protocol: Sans-I/O connection.

    é   é
   é   ©Úping_intervalÚping_timeoutÚclose_timeoutÚ	max_queueÚsockúsocket.socketÚprotocolr   r;   úfloat | Noner<   r=   r>   ú*int | None | tuple[int | None, int | None]ÚreturnÚNonec               ó˜   •— |  t          j        ¦   «         | _        d| _        t	          ¦   «                              ||||||¬¦  «         d S )NTr:   )Ú	threadingr   Úresponse_rcvdÚpending_legacy_warningÚsuperÚ__init__)Úselfr?   rA   r;   r<   r=   r>   Ú	__class__s          €úGC:\Projects\Historical\venv\Lib\site-packages\websockets/sync/client.pyrK   zClientConnection.__init__E   s`   ø€ ð 	Ð%Ý&œ_Ñ.Ô.ˆÔØ&*ˆÔ#Ý‰Œ×ÒØØØ'Ø%Ø'Øð 	ñ 	
ô 	
ð 	
ð 	
ð 	
ó    c                óR   •— d| _         t          ¦   «                              ¦   «         S )NF)rI   rJ   Ú	__enter__©rL   rM   s    €rN   rQ   zClientConnection.__enter__[   s!   ø€ Ø&+ˆÔ#Ý‰wŒw× Ò Ñ"Ô"Ð"rO   c                ó^   — | j         r%d| _         t          j        dt          d¬¦  «         d S d S )NFzžconnect() must be used as a context manager: with connect(...) as websocket: ...; alternatively, use websocket = connect(..., legacy=True) to connect directlyé   )Ú
stacklevel)rI   ÚwarningsÚwarnÚDeprecationWarning©rL   s    rN   Úmaybe_raise_legacy_warningz+ClientConnection.maybe_raise_legacy_warning_   sP   € ØÔ&ð 	Ø*/ˆDÔ'ÝŒMðLõ #Øðñ ô ð ð ð ð	ð 	rO   NÚadditional_headersúHeadersLike | NoneÚuser_agent_headerú
str | NoneÚtimeoutc                óî  — | j                              ¦   «         | _        |�| j        j                             |¦  «         |� | j        j                             d|¦  «         |                      t          ¬¦  «        5  | j                              | j        ¦  «         ddd¦  «         n# 1 swxY w Y   | j	         
                    |¦  «        st          d¦  «        ‚| j         j        �| j         j        ‚dS )z1
        Perform the opening handshake.

        Nz
User-Agent)Úexpected_statez.timed out while waiting for handshake response)rA   r/   ÚrequestÚheadersÚupdateÚ
setdefaultÚsend_contextr   Úsend_requestrH   ÚwaitÚTimeoutErrorÚhandshake_exc)rL   r[   r]   r_   s       rN   Ú	handshakezClientConnection.handshakej   s*  € ð ”}×,Ò,Ñ.Ô.ˆŒØÐ)ØŒLÔ ×'Ò'Ð(:Ñ;Ô;Ð;ØÐ(ØŒLÔ ×+Ò+¨LÐ:KÑLÔLÐLØ×Ò­jÐÑ9Ô9ð 	5ð 	5ØŒM×&Ò& t¤|Ñ4Ô4Ð4ð	5ð 	5ð 	5ñ 	5ô 	5ð 	5ð 	5ð 	5ð 	5ð 	5ð 	5øøøð 	5ð 	5ð 	5ð 	5ð Ô!×&Ò& wÑ/Ô/ð 	QÝÐOÑPÔPÐPð Œ=Ô&Ð2Ø”-Ô-Ð-ð 3Ð2s   Á= B)Â)B-Â0B-Úeventr   c                óÊ   •— | j         €9t          |t          ¦  «        sJ ‚|| _         | j                             ¦   «          dS t          ¦   «                              |¦  «         dS )z.
        Process one incoming event.

        N)ÚresponseÚ
isinstancer   rH   ÚsetrJ   Úprocess_event)rL   rl   rM   s     €rN   rq   zClientConnection.process_event†   se   ø€ ð Œ=Ð Ý˜e¥XÑ.Ô.Ð.Ð.Ð.Ø!ˆDŒMØÔ×"Ò"Ñ$Ô$Ð$Ð$Ð$õ ‰GŒG×!Ò! %Ñ(Ô(Ð(Ð(Ð(rO   c                ó¸   •— 	 t          ¦   «                              ¦   «          | j                             ¦   «          dS # | j                             ¦   «          w xY w)zI
        Read incoming data from the socket and process events.

        N)rJ   Úrecv_eventsrH   rp   rR   s    €rN   rs   zClientConnection.recv_events”   sV   ø€ ð
	%Ý‰GŒG×ÒÑ!Ô!Ð!ð Ô×"Ò"Ñ$Ô$Ð$Ð$Ð$øˆDÔ×"Ò"Ñ$Ô$Ð$Ð$øøøs	   ƒ > ¾A)r?   r@   rA   r   r;   rB   r<   rB   r=   rB   r>   rC   rD   rE   ©rD   r3   )rD   rE   )r[   r\   r]   r^   r_   rB   rD   rE   )rl   r   rD   rE   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__rK   rQ   rZ   r   rk   rq   rs   Ú__classcell__)rM   s   @rN   r3   r3   +   sñ   ø€ € € € € ðð ð< ')Ø%'Ø&(Ø@Bð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð,#ð #ð #ð #ð #ð #ð	ð 	ð 	ð 	ð 26Ø(2Ø $ð	.ð .ð .ð .ð .ð8)ð )ð )ð )ð )ð )ð	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%rO   r3   c                  óŠ   — e Zd ZdZddddddddedddeddddeddddd	œdKd4„ZdLd8„ZdMd9„Z	dNd;„Z
dOd?„ZdPd@„ZdPdA„ZdQdH„ZdRdJ„ZdS )Sr1   as  
    Similar to :func:`connect`, with support for automatic reconnection.

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

        for websocket in reconnect(...):
            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:`reconnect` accepts the same arguments as :func:`connect`, minus the
    ``legacy`` flag, plus those listed below. It raises the same exceptions.

    Args:
        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.
        reconnect_delays: Delays in seconds between reconnection attempts.
            Default is exponential backoff with 5s jitter, capped at 60s.

    .. admonition:: Why is :func:`reconnect` a separate API from :func:`connect`?
        :class: tip

        A new API was necessary to maintain backwards compatibility with this
        historical behavior of :func:`connect`::

            websocket = connect(...)
            for message in websocket:
                ...

        Once the deprecation period elapses, :func:`connect` will be changed to
        behave like :func:`reconnect` by default.

    NÚdeflateTr8   r7   é   r9   )r?   ÚsslÚserver_hostnameÚoriginÚ
extensionsÚsubprotocolsÚcompressionr[   r]   ÚproxyÚ	proxy_sslÚproxy_server_hostnamer   Úopen_timeoutr;   r<   r=   Úreconnect_delaysÚmax_sizer>   ÚloggerÚcreate_connectionÚuriÚstrr?   úsocket.socket | Noner}   ússl_module.SSLContext | Noner~   r^   r   úOrigin | Noner€   ú'Sequence[ClientExtensionFactory] | Noner�   úSequence[Subprotocol] | Noner‚   r[   r\   r]   rƒ   ústr | Literal[True] | Noner„   r…   r   ú'Callable[[Exception], Exception | None]r†   rB   r;   r<   r=   r‡   úCallable[[], Generator[float]]rˆ   rC   r>   r‰   úLoggerLike | NonerŠ   útype[ClientConnection] | NoneÚkwargsr   rD   rE   c               óº  — |€3d|v r/|                      d¦  «        }t          j        dt          ¦  «         || _        t          |¦  «        | _        | j        j        s|�t          d¦  «        ‚|�t          |¦  «         |dk    rt          |¦  «        }n|�t          d|› �¦  «        ‚|€t          j        d¦  «        }|€t          }|| _        || _        || _        |	| _        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        t9          |||||¬¦  «        | _        t9          ||||¬¦  «        | _        d S )	NÚssl_contextzssl_context was renamed to sslz-ssl argument is incompatible with a ws:// URIr{   zunsupported compression: zwebsockets.client)r   r€   r�   rˆ   r‰   r:   )ÚpoprV   rW   rX   r‹   r+   Úws_uriÚsecureÚ
ValueErrorr   r   ÚloggingÚ	getLoggerr3   r?   r}   r~   r[   r]   rƒ   r„   r…   r   r†   r‡   r‰   rŠ   Úopen_socket_kwargsÚdictÚprotocol_kwargsÚconnection_kwargs)rL   r‹   r?   r}   r~   r   r€   r�   r‚   r[   r]   rƒ   r„   r…   r   r†   r;   r<   r=   r‡   rˆ   r>   r‰   rŠ   r—   s                            rN   rK   zreconnect.__init__Í   sŸ  € ðJ ˆ;˜=¨FÐ2Ð2Ø—*’*˜]Ñ+Ô+ˆCÝŒMØ0Ý"ñô ð ð
 ˆŒÝ ‘n”nˆŒØŒ{Ô!ð 	N c oÝÐLÑMÔMÐMàÐ#Ý! ,Ñ/Ô/Ð/à˜)Ò#Ð#Ý9¸*ÑEÔEˆJˆJØÐ$ÝÐF¸ÐFÐFÑGÔGÐGàˆ>ÝÔ&Ð':Ñ;Ô;ˆFàÐ$Ý 0ÐàˆŒ	ØˆŒØ.ˆÔØ"4ˆÔØ!2ˆÔØˆŒ
Ø"ˆŒØ%:ˆÔ"Ø!2ˆÔØ(ˆÔØ 0ˆÔØˆŒØ!2ˆÔØ"(ˆÔÝ#ØØ!Ø%ØØð 
ñ  
ô  
ˆÔõ "&Ø'Ø%Ø'Øð	"
ñ "
ô "
ˆÔÐÐrO   Údeadliner.   r@   c           	     óz  — | j                              ¦   «         }|                     dd¦  «        }| j        }|rd}|du rt	          | j        ¦  «        }|r°t          j        t          j        t          j        ¦  «        }	 | 	                    | 
                    ¦   «         ¦  «         |                     t          j        |                     d¦  «        ¦  «        ¦  «         �nD# t          $ r |                     ¦   «          ‚ w xY w|�ºt!          |¦  «        }|j        dd…         dk    r-t%          || j        ||                     dd¦  «        ¬	¦  «        }nÐ|j        dd
…         dk    rI|j        dk    r| j        �t)          d¦  «        ‚t+          || j        |f| j        | j        | j        dœ|¤Ž}ntt1          d¦  «        ‚|                     d| j        j        | j        j        f¦  «         |                     d| 
                    ¦   «         ¦  «         t          j        di |¤Ž}| 	                    d¦  «         |S )zFOpen a TCP or Unix connection to the server, possibly through a proxy.ÚunixFNTÚpathé   ÚsocksÚsource_address)Ú
local_addré   ÚhttpÚhttpsz8proxy_ssl argument is incompatible with an http:// proxy©r]   r}   r~   z&parse_proxy returned unsupported proxyÚaddressr_   © )r    Úcopyrš   rƒ   r!   r›   ÚsocketÚAF_UNIXÚSOCK_STREAMÚ
settimeoutr_   r/   ÚosÚfspathÚ	ExceptionÚcloser"   ÚschemeÚconnect_socks_proxyr„   r�   Úconnect_http_proxyr]   r…   ÚAssertionErrorre   ÚhostÚportrŠ   )rL   r¤   r—   r¦   rƒ   r?   Úproxy_parseds          rN   Úopen_socketzreconnect.open_socket(  s\  € àÔ(×-Ò-Ñ/Ô/ˆØ�zŠz˜& %Ñ(Ô(ˆà”
ˆØð 	ØˆEØ�Dˆ=ˆ=Ý˜dœkÑ*Ô*ˆEàð +	6Ý”=¥¤µÔ1CÑDÔDˆDðØ—’ × 0Ò 0Ñ 2Ô 2Ñ3Ô3Ð3Ø—’�RœY v§z¢z°&Ñ'9Ô'9Ñ:Ô:Ñ;Ô;Ð;Ñ;øÝð ð ð Ø—
’
‘”�Øðøøøð ÐÝ& uÑ-Ô-ˆLàÔ" 2 A 2Ô&¨'Ò1Ð1Ý*Ø Ø”KØð  &ŸzšzÐ*:¸DÑAÔAðñ ô ��ð Ô$ R a RÔ(¨FÒ2Ð2ØÔ&¨'Ò1Ð1°d´nÐ6PÝ$ØRñô ð õ *Ø Ø”KØðð '+Ô&<ØœØ$(Ô$>ðð ð ðð ��õ %Ð%MÑNÔNÐNð ×Ò˜i¨$¬+Ô*:¸D¼KÔ<LÐ)MÑNÔNÐNØ×Ò˜i¨×)9Ò)9Ñ);Ô);Ñ<Ô<Ð<ÝÔ+Ð5Ð5¨fÐ5Ð5ˆDà�Š˜ÑÔÐØˆs   Á?A!C" Ã" Dc                óŽ  — | j         €t          j        ¦   «         }n| j         }| j        €| j        j        }n| j        }|                     |                     ¦   «         ¦  «         | j        €| 	                    ||¬¦  «        }n,t          |||¬¦  «        }t          t          j        |¦  «        }|                     d¦  «         |S )zEnable TLS on the connection.N©r~   )r}   Ú
ssl_moduleÚcreate_default_contextr~   r›   r¿   r¶   r_   r„   Úwrap_socketÚSSLSSLSocketr   r³   )rL   r?   r¤   r}   r~   Úsock_2s         rN   Ú
enable_tlszreconnect.enable_tlsc  s·   € àŒ8ÐÝÔ3Ñ5Ô5ˆCˆCà”(ˆCØÔÐ'Ø"œkÔ.ˆOˆOà"Ô2ˆOØ�Š˜×(Ò(Ñ*Ô*Ñ+Ô+Ð+ØŒ>Ð!Ø—?’? 4¸�?ÑIÔIˆDˆDå! $¨¸_ÐMÑMÔMˆFå�œ vÑ.Ô.ˆDØ�Š˜ÑÔÐØˆrO   r3   c                ó¨  — | j         €|                      |¦  «        }n| j         }	 |j        t          j        t          j        hv r+|                     t          j        t          j        d¦  «         | j	        j
        r|                      ||¦  «        }t          | j	        fi | j        ¤Ž} | j        ||fi | j        ¤Ž}n## t           $ r |                     ¦   «          ‚ w xY w	 |                     | j        | j        |                     ¦   «         ¦  «         n<# t           $ r/ |                     ¦   «          |j                             ¦   «          ‚ w xY w|S )zCreate a WebSocket connection.NT)r?   rÂ   Úfamilyr³   ÚAF_INETÚAF_INET6Ú
setsockoptÚIPPROTO_TCPÚTCP_NODELAYr›   rœ   rÊ   r   r¢   rŠ   r£   r¹   rº   rk   r[   r]   r_   Úclose_socketÚrecv_events_threadÚjoin)rL   r¤   r?   rA   Ú
connections        rN   Úopen_connectionzreconnect.open_connectionw  sŠ  € àŒ9ÐØ×#Ò# HÑ-Ô-ˆDˆDà”9ˆDð	ØŒ{�vœ~­v¬Ð?Ð?Ð?Ø—’¥Ô 2µFÔ4FÈÑMÔMÐMàŒ{Ô!ð 7Ø—’ t¨XÑ6Ô6�å%Ø”ðð àÔ&ðð ˆHð 0˜Ô/ØØðð ð Ô(ðð ˆJˆJøõ ð 	ð 	ð 	Ø�JŠJ‰LŒLˆLØð	øøøð		Ø× Ò ØÔ'ØÔ&Ø× Ò Ñ"Ô"ñô ð ð øõ
 ð 	ð 	ð 	Ø×#Ò#Ñ%Ô%Ð%ØÔ)×.Ò.Ñ0Ô0Ð0Øð	øøøð
 Ðs   ¦BB> Â> CÃ"3D Ä9EÚexcr¹   úException | strc                ó  — t          |t          ¦  «        r|j        j        dv rd|j        j        v s|S | j        }t          j                             | j	        |j        j        d         ¦  «        }t          |¦  «        }| j        �t          d|› d�¦  «        S |j        r|j        st          d|› �¦  «        S |j        |j        k    s |j        |j        k    s|j        |j        k    r¤| j                             dd¦  «        rt          d	|› d
�¦  «        S | j                             d¦  «        �t          d	|› d�¦  «        S | j        �Bt)          d„ t)          | 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  ÚLocationNz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°   z with an explicit host and portc              3  óP   K  — | ]!\  }}|                      ¦   «         d v¯||fV — Œ"dS ))ÚauthorizationÚcookiezproxy-authorizationN)Úlower)Ú.0ÚkeyÚvalues      rN   ú	<genexpr>z-reconnect.process_redirect.<locals>.<genexpr>Ý  s\   è è € ð ð á&˜C ØŸ9š9™;œ;ØQðRð Rð ˜e˜ðRð Rð Rð Rðð rO   )ro   r   rn   Ústatus_coderc   r›   ÚurllibÚparseÚurljoinr‹   r+   r?   r�   rœ   r   r¿   rÀ   r    Úgetr[   r   Ú	raw_items)rL   r×   Ú
old_ws_uriÚnew_uriÚ
new_ws_uris        rN   Úprocess_redirectzreconnect.process_redirect¢  sã  € õ �s�MÑ*Ô*ð	à”Ô(ððð ð ˜cœlÔ2Ð2Ð2àˆJà”[ˆ
Ý”,×&Ò& t¤x°´Ô1EÀjÔ1QÑRÔRˆÝ˜wÑ'Ô'ˆ
ð Œ9Ð ÝØP¨WÐPÐPÐPñô ð ð
 Ôð 	X ZÔ%6ð 	XÝ Ð!VÈWÐ!VÐ!VÑWÔWÐWð Ô Ô!2Ò2Ð2ØŒ *¤/Ò1Ð1ØŒ *¤/Ò1Ð1ð Ô&×*Ò*¨6°5Ñ9Ô9ð Ý!ð*¸gð *ð *ð *ñô ð ð Ô&×*Ò*¨9Ñ5Ô5ÐAÝ!ð6¸gð 6ð 6ð 6ñô ð ð Ô&Ð2Ý*1ðð å*1°$Ô2IÑ*JÔ*J×*TÒ*TÑ*VÔ*Vðñ ô ñ+ô +�Ô'ð ˆrO   c                óª  — t          | j        ¦  «        }t          t          ¦  «        D ]“}	 |                      |¦  «        }|                     ¦   «          |c S # t          $ rW}|                      |¦  «        }t          |t          ¦  «        r||u r‚ ||‚|| _	        t          |¦  «        | _        Y d}~ŒŒd}~ww xY wt          dt          › d�¦  «        ‚)z3Connect to a WebSocket server, following redirects.Nz
more than z
 redirects)r.   r†   ÚrangeÚMAX_REDIRECTSrÖ   Ústart_keepaliver¹   rí   ro   r‹   r+   r›   r   )rL   r¤   Ú_rÕ   r×   Ú
exc_or_uris         rN   r/   zreconnect.connectç  s   € õ
 ˜DÔ-Ñ.Ô.ˆå•}Ñ%Ô%ð 	Hð 	HˆAð"Ø!×1Ò1°(Ñ;Ô;�
ð  ×*Ò*Ñ,Ô,Ð,Ø!Ð!Ð!Ð!øõ! ð ð ð Ø!×2Ò2°3Ñ7Ô7�
Ý˜j­)Ñ4Ô4ð 
à! SÐ(Ð(Øà(¨cÐ1ð  *�D”HÝ"+¨JÑ"7Ô"7�D”KØ�H�H�H�Høøøøðøøøõ$  Ð F­]Ð FÐ FÐ FÑGÔGÐGs   ¬AÁ
B:Á#AB5Â5B:c                ó¼   — t          | d¦  «        rt          d¦  «        ‚|                      ¦   «         | _        d| j        _        | j                             ¦   «         S )NrÕ   zconnect() isn't reentrantF)ÚhasattrÚRuntimeErrorr/   rÕ   rI   rQ   rY   s    rN   rQ   zreconnect.__enter__  sP   € Ý�4˜Ñ&Ô&ð 	<ÝÐ:Ñ;Ô;Ð;ØŸ,š,™.œ.ˆŒØ16ˆŒÔ.ØŒ×(Ò(Ñ*Ô*Ð*rO   Úexc_typeútype[BaseException] | NoneÚ	exc_valueúBaseException | NoneÚexc_tracebackúTracebackType | Nonec                óN   — 	 | j                              |||¦  «        | ` S # | ` w xY w©N)rÕ   Ú__exit__)rL   r÷   rù   rû   s       rN   rÿ   zreconnect.__exit__  s6   € ð	 Ø”?×+Ò+¨H°iÀÑOÔOà��ø��ÐÐÐÐs   ‚   $úIterator[ClientConnection]c              #  óò  K  — d }	 	 | 5 }|V — d d d ¦  «         n# 1 swxY w Y   d }nÐ# t           $ rÃ}	 |                      |¦  «        }n# t           $ r}|}Y d }~nd }~ww xY w||u r‚ |�||‚|€|                      ¦   «         }t          |¦  «        }| j                             d|t          j        |¦  «        d                              ¦   «         ¦  «         t          j
        |¦  «         Y d }~nd }~ww xY wŒó)NTz0connect failed; reconnecting in %.1f seconds: %sr   )r¹   r   r‡   Únextr‰   ÚinfoÚ	tracebackÚformat_exception_onlyÚstripÚtimeÚsleep)rL   ÚdelaysrÕ   r×   Únew_excÚ
raised_excÚdelays          rN   Ú__iter__zreconnect.__iter__  s�  è è € Ø*.ˆð#	ð"Øð %˜ZØ$Ð$Ð$Ð$ð%ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %ðB ��øõ? ð "ð "ð "ð
)Ø"×4Ò4°SÑ9Ô9�G�GøÝ ð )ð )ð )Ø(�G�G�G�G�G�Gøøøøð)øøøð
 ˜c�>�>ØØÐ&Ø! sÐ*ð �>Ø!×2Ò2Ñ4Ô4�FÝ˜V™œ�Ø”× Ò ØFØÝÔ3°CÑ8Ô8¸Ô;×AÒAÑCÔCñô ð õ
 ”
˜5Ñ!Ô!Ð!Ð!Ð!Ð!Ð!Ð!øøøøð7"øøøð	#	sQ   ‡( ‰Ž( šž( ¡¢( ¨
C5³A	ÁC0Á	
AÁAÁC0ÁAÁBC0Ã0C5)2r‹   rŒ   r?   r�   r}   rŽ   r~   r^   r   r�   r€   r�   r�   r‘   r‚   r^   r[   r\   r]   r^   rƒ   r’   r„   rŽ   r…   r^   r   r“   r†   rB   r;   rB   r<   rB   r=   rB   r‡   r”   rˆ   rC   r>   rC   r‰   r•   rŠ   r–   r—   r   rD   rE   )r¤   r.   rD   r@   )r?   r@   r¤   r.   rD   r@   )r¤   r.   rD   r3   )r×   r¹   rD   rØ   rt   )r÷   rø   rù   rú   rû   rü   rD   rE   )rD   r   )ru   rv   rw   rx   r   r   r   rK   rÂ   rÊ   rÖ   rí   r/   rQ   rÿ   r  r±   rO   rN   r1   r1       s5  € € € € € ð*ð *ðb &*Ø,0Ø&*à $Ø>BØ59Ø"+à15Ø(2Ø,0Ø26Ø,0ØEVà%'Ø&(Ø%'Ø&(Ø;Bà?DØ@Bà$(à;?ðAY
ð Y
ð Y
ð Y
ð Y
ð Y
ðv9ð 9ð 9ð 9ðvð ð ð ð()ð )ð )ð )ðVCð Cð Cð CðJHð Hð Hð Hð@+ð +ð +ð +ð	 ð 	 ð 	 ð 	 ð%ð %ð %ð %ð %ð %rO   r1   .)r?   r}   r~   r   r€   r�   r‚   r[   r]   rƒ   r„   r…   r†   r;   r<   r=   rˆ   r>   r‰   rŠ   Úlegacyr‹   rŒ   r?   r�   r}   rŽ   r~   r^   r   r�   r€   r�   r�   r‘   r‚   r[   r\   r]   rƒ   r’   r„   r…   r†   rB   r;   r<   r=   rˆ   rC   r>   r‰   r•   rŠ   r–   r  úLiteral[True] | Noner—   r   rD   c               ó   — d S rþ   r±   ©r‹   r?   r}   r~   r   r€   r�   r‚   r[   r]   rƒ   r„   r…   r†   r;   r<   r=   rˆ   r>   r‰   rŠ   r  r—   s                          rN   r/   r/   C  s
   € ðF �srO   )r?   r}   r~   r   r€   r�   r‚   r[   r]   rƒ   r„   r…   r†   r;   r<   r=   rˆ   r>   r‰   rŠ   úLiteral[False]c               ó   — d S rþ   r±   r  s                          rN   r/   r/   i  s
   € ðF �rO   r{   Tr8   r7   r|   r9   úbool | NoneúClientConnection | reconnectc               óÞ   — t          | fi d|“d|“d|“d|“d|“d|“d|“d|“d	|	“d
|
“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“|¤Ž}|du r|S |                     ¦   «         }|rd|_        |S )aŒ  
    Connect to the WebSocket server at ``uri``.

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

        from websockets.sync.client import connect

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

    The connection is closed automatically when exiting the context.

    Use :func:`reconnect` to reconnect automatically on errors.

    For backwards compatibility, :func:`connect` can be called directly::

        websocket = connect(..., legacy=True)

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

    When the ``legacy`` flag is enabled, :func:`connect` returns directly a
    :class:`ClientConnection` and iterating that connection yields messages.
    Currently, this is the default behavior when ``legacy`` isn't specified.

    When the ``legacy`` flag is explicitly disabled, :func:`connect` behaves
    like :func:`reconnect`: using it as an iterator returns a new connection
    at each iteration, making it easy to reconnect automatically on errors.

    Args:
        uri: URI of the WebSocket server.
        sock: Preexisting TCP socket. ``sock`` overrides the host and port
            from ``uri``. You may call :func:`socket.create_connection` to
            create a suitable TCP socket.
        ssl: Configuration for enabling TLS on the connection.
        server_hostname: Host name for the TLS handshake. ``server_hostname``
            overrides the host name from ``uri``.
        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.
        proxy_ssl: Configuration for enabling TLS on the proxy connection.
        proxy_server_hostname: Host name for the TLS handshake with the proxy.
            ``proxy_server_hostname`` overrides the host name from ``proxy``.
        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.
        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.
        logger: Logger for this client.
            It defaults to ``logging.getLogger("websockets.client")``.
            See the :doc:`logging guide <../../topics/logging>` for details.
        legacy: Set to :obj:`True` to opt into the historical behavior of
            returning a :class:`ClientConnection`, without deprecation warning.
        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 :func:`~socket.create_connection`.
    For example, you can set ``address`` to a ``(host, port)`` tuple 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.

    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.

    r?   r}   r~   r   r€   r�   r‚   r[   r]   rƒ   r„   r…   r†   r;   r<   r=   rˆ   r>   r‰   rŠ   F)r1   r/   rI   )r‹   r?   r}   r~   r   r€   r�   r‚   r[   r]   rƒ   r„   r…   r†   r;   r<   r=   rˆ   r>   r‰   rŠ   r  r—   Ú	connecterrÕ   s                            rN   r/   r/   �  sP  € õJ Øðð ð àˆTðð ˆCðð (˜ð	ð
 ˆvðð �:ðð "�\ðð  �Kðð .Ð-ðð ,Ð+ðð ˆeðð �)ðð 4Ð3ðð "�\ðð $�mðð  "�\ð!ð" $�mð#ð$ �ð%ð& �)ð'ð( ˆvð)ð* ,Ð+Ø
ð-ð €Ið4 �€€ØÐØ×"Ò"Ñ$Ô$€Jð ð 2Ø,1ˆ
Ô)ØÐrO   r§   úPathLike | Nonec                óú   — |                      d¦  «        }| €|€t          d¦  «        ‚| �|�t          d¦  «        ‚|€/|                      d¦  «        €|                      d¦  «        €d}nd}t          d|d	| d
œ|¤ŽS )z¦
    Similar to :func:`unix_connect`, with support for automatic reconnection.

    Refer to the documentation of :func:`reconnect` for details on its behavior.

    r?   Nzmissing path argumentzpath is incompatible with sockr}   r™   zws://localhost/zwss://localhost/T)r‹   r¦   r§   r±   )rè   r�   r1   )r§   r‹   r—   r?   s       rN   r2   r2   8  s˜   € ð �:Š:�fÑÔ€DØ€|˜˜ÝÐ0Ñ1Ô1Ð1Ø	Ð	˜dÐ.ÝÐ9Ñ:Ô:Ð:à
€{à�:Š:�eÑÔÐ$¨¯ª°MÑ)BÔ)BÐ)JØ#ˆCˆCà$ˆCåÐ=˜ 4¨dÐ=Ð=°fÐ=Ð=Ð=rO   )r  c               ó   — d S rþ   r±   ©r§   r‹   r  r—   s       rN   r0   r0   S  s	   € ð �srO   c               ó   — d S rþ   r±   r  s       rN   r0   r0   ]  s	   € ð �rO   c               óh   — t          | |fi |¤Ž}|du r|S |                     ¦   «         }|r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`` is provided, to
            ``wss://localhost/``.

    F)r2   r/   rI   )r§   r‹   r  r—   r  rÕ   s         rN   r0   r0   g  sU   € õ. ˜t SÐ3Ð3¨FÐ3Ð3€Ið �€€ØÐØ×"Ò"Ñ$Ô$€Jð ð 2Ø,1ˆ
Ô)ØÐrO   )Ú	ProxyType)r    )Úsocks5hÚsocks5Úsocks4aÚsocks4Fr    r›   r*   r¤   r.   r@   c           	     ó’  — t          t          | j                 | j        | j        | j        | j        t          | j                 ¦  «        }|                     d| 	                    ¦   «         ¦  «         	  |j
        |j        |j        fi |¤ŽS # t          t          t          j	        f$ r ‚ t          $ r}t          d¦  «        |‚d}~ww xY w)z0Connect via a SOCKS proxy and return the socket.r_   z failed to connect to SOCKS proxyN)Ú
SocksProxyÚSOCKS_PROXY_TYPESr»   r¿   rÀ   ÚusernameÚpasswordÚSOCKS_PROXY_RDNSre   r_   r/   ÚOSErrorri   r³   r¹   r   )rƒ   r›   r¤   r—   Úsocks_proxyr×   s         rN   r¼   r¼   ¨  sØ   € õ !Ý˜eœlÔ+ØŒJØŒJØŒNØŒNÝ˜Uœ\Ô*ñ
ô 
ˆð 	×Ò˜) X×%5Ò%5Ñ%7Ô%7Ñ8Ô8Ð8ð	JØ&�;Ô& v¤{°F´KÐJÐJÀ6ÐJÐJÐJøÝ�¥v¤~Ð6ð 	ð 	ð 	ØÝð 	Jð 	Jð 	JÝÐ?Ñ@Ô@ÀcÐIøøøøð	Jøøøs   Á2B Â&CÂ1CÃCc                ó    — t          d¦  «        ‚)Nz6connecting through a SOCKS proxy requires python-socks)ÚImportError)rƒ   r›   r¤   r—   s       rN   r¼   r¼   ‘  s   € õ ÐRÑSÔSÐSrO   r   c                óò  — t          ¦   «         }t          j        |j        |j        |j        d¬¦  «        }	 	 |                      |                     ¦   «         ¦  «         |                      d¦  «        }|r| 	                    |¦  «         n| 
                    ¦   «          t          |¦  «         Œx# t          $ rh}t          |j        t          ¦  «        sJ ‚|j        }d|j        cxk    rdk     rn n|cY d }~|                      d ¦  «         S t!          |¦  «        ‚d }~wt"          j        $ r t%          d¦  «        ‚t&          $ r}t)          d¦  «        |‚d }~ww xY w# |                      d ¦  «         w xY w)NT)rƒ   i   éÈ   rÚ   z(timed out while connecting to HTTP proxyz0did not receive a valid HTTP response from proxy)r$   r   ræ   Ú	read_lineÚ
read_exactÚread_to_eofr¶   r_   ÚrecvÚ	feed_dataÚfeed_eofr  ÚStopIterationro   râ   rä   r   r³   ri   r¹   r   )r?   r¤   ÚreaderÚparserÚdatar×   rn   s          rN   Úread_connect_responser9  Â  s´  € Ý‰^Œ^€FÝŒ^ØÔØÔØÔØð	ñ ô €Fðð	Ø�OŠO˜H×,Ò,Ñ.Ô.Ñ/Ô/Ð/Ø—9’9˜T‘?”?ˆDØð "Ø× Ò  Ñ&Ô&Ð&Ð&à—’Ñ!Ô!Ð!Ý�‰LŒLˆLð	øõ ð /ð /ð /Ý˜#œ)¥XÑ.Ô.Ð.Ð.Ð.Ø”9ˆØ�(Ô&Ð,Ð,Ò,Ð,¨Ò,Ð,Ð,Ð,Ð,ØˆOˆOˆOˆOˆOð 	�Š˜ÑÔÐÐõ % XÑ.Ô.Ð.øøøøÝŒ>ð Gð Gð GÝÐEÑFÔFÐFÝð ð ð Ý!Ø>ñ
ô 
àð	øøøøðøøøøð
 	�Š˜ÑÔÐÐøøøsB   ·A9B0 Â0
EÂ:9DÃ3EÃ4E ÄDÄ*EÅEÅEÅE ÅE6r¯   c               ó@  — |                      d|                     ¦   «         ¦  «         t          j        | j        | j        ffi |¤Ž}| j        dk    rq|€t          j        ¦   «         }|€| j        }| 	                    |                     ¦   «         ¦  «         | 
                    ||¬¦  «        }| 	                    d ¦  «         t          | ||¦  «        }|                     |¦  «         	 t          ||¦  «         n## t          $ r |                     ¦   «          ‚ w xY w|S )Nr_   r®   rÄ   )re   r_   r³   rŠ   r¿   rÀ   r»   rÅ   rÆ   r¶   rÇ   r#   Úsendallr9  r¹   rº   )	rƒ   r›   r¤   r]   r}   r~   r—   r?   rb   s	            rN   r½   r½   ä  s+  € ð ×Ò�i ×!1Ò!1Ñ!3Ô!3Ñ4Ô4Ð4ÝÔ# U¤Z°´Ð$<ÐGÐGÀÐGÐG€Dð „|�wÒÐØˆ;ÝÔ3Ñ5Ô5ˆCØÐ"Ø#œjˆOØ�Š˜×(Ò(Ñ*Ô*Ñ+Ô+Ð+Ø�Š˜t°_ˆÑEÔEˆØ�Š˜ÑÔÐõ & e¨VÐ5FÑGÔG€GØ‡L‚L�ÑÔÐðÝ˜d HÑ-Ô-Ð-Ð-øÝð ð ð Ø�
Š
‰ŒˆØðøøøð €Ks   Ã*C; Ã; DÚTÚF)Úboundc                  óJ   — e Zd ZdZdZ	 ddd„Zd d„Zd!d„Zd"d„Zd#d„Z	d$d„Z
dS )%rÈ   zr
    Socket-like object providing TLS-in-TLS.

    Only methods that are used by websockets are implemented.

    i   Nr?   r@   r™   ússl_module.SSLContextr~   r^   rD   rE   c                ó   — t          j        ¦   «         | _        t          j        ¦   «         | _        || _        |                     | j        | j        |¬¦  «        | _        |                      | j        j        ¦  «         d S )NrÄ   )	rÅ   Ú	MemoryBIOÚincomingÚoutgoingÚ
ssl_socketÚwrap_bioÚ
ssl_objectÚrun_ioÚdo_handshake)rL   r?   r™   r~   s       rN   rK   zSSLSSLSocket.__init__  ss   € õ #Ô,Ñ.Ô.ˆŒÝ"Ô,Ñ.Ô.ˆŒØˆŒØ%×.Ò.ØŒMØŒMØ+ð /ñ 
ô 
ˆŒð
 	�Š�D”OÔ0Ñ1Ô1Ð1Ð1Ð1rO   ÚfuncúCallable[..., T]Úargsr   r<  c                ó�  — 	 d}d}	  ||Ž }n)# t           j        $ r d}Y nt           j        $ r d}Y nw xY w| j                             ¦   «         }|r| j                             |¦  «         |rV| j                             | j        ¦  «        }|r| j	         
                    |¦  «         n| j	                             ¦   «          ŒÂ|rŒÅ|S )NTF)rÅ   ÚSSLWantReadErrorÚSSLWantWriteErrorrD  ÚreadrE  r;  r2  Úrecv_bufsizerC  ÚwriteÚ	write_eof)rL   rJ  rL  Ú	want_readÚ
want_writeÚresultr8  s          rN   rH  zSSLSSLSocket.run_io)  s  € ð	ØˆIØˆJð"Ø˜˜t˜��øÝÔ.ð !ð !ð !Ø �	�	�	ÝÔ/ð "ð "ð "Ø!�
�
�
ð"øøøð ”=×%Ò%Ñ'Ô'ˆDØð .Ø”×'Ò'¨Ñ-Ô-Ð-ð ð Ø”×+Ò+¨DÔ,=Ñ>Ô>�Øð .Ø”M×'Ò'¨Ñ-Ô-Ð-Ð-à”M×+Ò+Ñ-Ô-Ð-Øàð ØàˆMs   ‡ �3 3²3ÚbuflenÚintÚbytesc                óp   — 	 |                       | j        j        |¦  «        S # t          j        $ r Y dS w xY w)NrO   )rH  rG  rP  rÅ   ÚSSLEOFError)rL   rW  s     rN   r2  zSSLSSLSocket.recvG  sE   € ð	Ø—;’;˜tœÔ3°VÑ<Ô<Ð<øÝÔ%ð 	ð 	ð 	Ø�3�3ð	øøøs   ‚" ¢5´5r8  r%   c                óB   — |                       | j        j        |¦  «        S rþ   )rH  rG  rR  )rL   r8  s     rN   ÚsendzSSLSSLSocket.sendM  s   € Ø�{Š{˜4œ?Ô0°$Ñ7Ô7Ð7rO   c                ó*  — d}t          |¦  «        5 }|                     d¦  «        5 }t          |¦  «        }||k     r&||                      ||d …         ¦  «        z  }||k     °&d d d ¦  «         n# 1 swxY w Y   d d d ¦  «         d S # 1 swxY w Y   d S )Nr   ÚB)Ú
memoryviewr   Úlenr]  )rL   r8  ÚcountÚviewÚ	byte_viewÚamounts         rN   r;  zSSLSSLSocket.sendallP  s  € àˆÝ˜ÑÔð 	6  t§y¢y°¡~¤~ð 	6¸Ý˜‘^”^ˆFØ˜&’.�.Ø˜Ÿš 9¨U¨V¨VÔ#4Ñ5Ô5Ñ5�ð ˜&’.�.ð	6ð 	6ð 	6ñ 	6ô 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6øøøð 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6ñ 	6ô 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6ð 	6øøøð 	6ð 	6ð 	6ð 	6ð 	6ð 	6s4   ’B¨<A0Á$BÁ0A4	Á4BÁ7A4	Á8BÂBÂBÚnamerŒ   c                ó,   — t          | j        |¦  «        S rþ   )ÚgetattrrE  )rL   rf  s     rN   Ú__getattr__zSSLSSLSocket.__getattr__[  s   € Ý�t”¨Ñ-Ô-Ð-rO   rþ   )r?   r@   r™   r@  r~   r^   rD   rE   )rJ  rK  rL  r   rD   r<  )rW  rX  rD   rY  )r8  r%   rD   rX  )r8  r%   rD   rE   )rf  rŒ   rD   r   )ru   rv   rw   rx   rQ  rK   rH  r2  r]  r;  ri  r±   rO   rN   rÈ   rÈ     s§   € € € € € ðð ð €Lð '+ð	2ð 2ð 2ð 2ð 2ð ð ð ð ð<ð ð ð ð8ð 8ð 8ð 8ð6ð 6ð 6ð 6ð.ð .ð .ð .ð .ð .rO   rÈ   )0r‹   rŒ   r?   r�   r}   rŽ   r~   r^   r   r�   r€   r�   r�   r‘   r‚   r^   r[   r\   r]   r^   rƒ   r’   r„   rŽ   r…   r^   r†   rB   r;   rB   r<   rB   r=   rB   rˆ   rC   r>   rC   r‰   r•   rŠ   r–   r  r  r—   r   rD   r3   )0r‹   rŒ   r?   r�   r}   rŽ   r~   r^   r   r�   r€   r�   r�   r‘   r‚   r^   r[   r\   r]   r^   rƒ   r’   r„   rŽ   r…   r^   r†   rB   r;   rB   r<   rB   r=   rB   rˆ   rC   r>   rC   r‰   r•   rŠ   r–   r  r  r—   r   rD   r1   )0r‹   rŒ   r?   r�   r}   rŽ   r~   r^   r   r�   r€   r�   r�   r‘   r‚   r^   r[   r\   r]   r^   rƒ   r’   r„   rŽ   r…   r^   r†   rB   r;   rB   r<   rB   r=   rB   rˆ   rC   r>   rC   r‰   r•   rŠ   r–   r  r  r—   r   rD   r  )NN)r§   r  r‹   r^   r—   r   rD   r1   )..)
r§   r  r‹   r^   r  r  r—   r   rD   r3   )
r§   r  r‹   r^   r  r  r—   r   rD   r1   )
r§   r  r‹   r^   r  r  r—   r   rD   r  )
rƒ   r    r›   r*   r¤   r.   r—   r   rD   r@   )r?   r@   r¤   r.   rD   r   )rƒ   r    r›   r*   r¤   r.   r]   r^   r}   rŽ   r~   r^   r—   r   rD   r@   )_Ú
__future__r   rž   r·   r³   r}   rÅ   rG   r  r  Úurllib.parserå   rV   Úcollections.abcr   r   r   Útypesr   Útypingr   r	   r
   r   r   r   Úclientr   r   r   Údatastructuresr   r   Ú
exceptionsr   r   r   r   r   Úextensions.baser   Úextensions.permessage_deflater   rc   r   Úhttp11r   r   rA   r   r   rƒ   r    r!   r"   r#   Ústreamsr$   r%   r&   r'   r(   r)   r‹   r*   r+   rÕ   r-   Úutilsr.   Ú__all__rX  Úenvironrè   rð   r3   r1   r/   r2   r0   Úpython_socksr  Úpython_socks.syncr$  ÚSOCKS5ÚSOCKS4r%  r(  r¼   r,  r9  r½   r<  r=  rÈ   r±   rO   rN   ú<module>r}     sO  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø Ð Ð Ð Ð Ð Ø BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ Bà ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1ðð ð ð ð ð ð ð ð ð ð ð ð ð ð 5Ð 4Ð 4Ð 4Ð 4Ð 4Ø LÐ LÐ LÐ LÐ LÐ LØ +Ð +Ð +Ð +Ð +Ð +Ø )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JØ "Ð "Ð "Ð "Ð "Ð "Ø IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IØ )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø "Ð "Ð "Ð "Ð "Ð "Ø Ð Ð Ð Ð Ð ð YÐ
XÐ
X€à��B”J—N’NÐ#=¸tÑDÔDÑEÔE€ðr%ð r%ð r%ð r%ð r%�zñ r%ô r%ð r%ðj`ð `ð `ð `ð `ñ `ô `ð `ðF 
ð
 "%Ø(+Ø"%àØ:=Ø14Ø!à-0Ø$'Ø(+Ø.1Ø(+à!$Ø"%Ø!$Ø"%à;>Ø<?à #à7:à#&ð?"ð "ð "ð "ð "ñ 
„ð"ðJ 
ð
 "%Ø(+Ø"%àØ:=Ø14Ø!à-0Ø$'Ø(+Ø.1Ø(+à!$Ø"%Ø!$Ø"%à;>Ø<?à #à7:ð;"ð "ð "ð "ð "ñ 
„ð"ðR "&Ø(,Ø"&à Ø:>Ø15Ø'à-1Ø$.Ø(,Ø.2Ø(,à!#Ø"$Ø!#Ø"$à;@Ø<>à $à7;àð?fð fð fð fð fð fðT !Øð>ð >ð >ð >ð >ð6 
àØðð $'ð	ð ð ð ð ñ 
„ðð 
àØðð ð ð ñ 
„ðð !Øð!ð ð	!ð !ð !ð !ð !ð !ðH4JØ&Ð&Ð&Ð&Ð&Ð&Ø5Ð5Ð5Ð5Ð5Ð5ð Ô#ØÔ"ØÔ#ØÔ"ð	ð Ðð ØØØð	ð ÐðJð Jð Jð Jð Jøð3 ð Tð Tð TðTð Tð Tð Tð Tð TðTøøøðfð ð ð ðN %)Ø(,Ø"&ð$ð $ð $ð $ð $ð $ðN €GˆC�L„L€Ø€GˆC�x  Q Ô'Ð(Ñ(Ô(€ðM.ð M.ð M.ð M.ð M.ñ M.ô M.ð M.ð M.ð M.s   ÆG
 Ç
	GÇG