+
     h.5  c                  s^   ^ RI Ht ^ RIt^ RIt^ RIt^RIHt ^RIHtH	t	 ^RI
HtHt ^RIHtHtHtHtHtHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHt ^RIHt ]P@                  ! R4      t!RRRRRRRR/t"RRRRRRRRRRRRRR R!R"R#R$/	t#R%R/R& R' llt$ ! R( R)]4      t% ! R* R+]4      t&R# ),    )annotationsN)SyncBackend)NetworkBackendNetworkStream)ConnectionNotAvailable
ProxyError)URLOriginRequestResponseenforce_bytesenforce_url)default_ssl_context)Lock)Trace)ConnectionPool)HTTP11Connection)ConnectionInterfacezhttpcore.sockss    zNO AUTHENTICATION REQUIREDs   ZGSSAPIs   zUSERNAME/PASSWORDs   zNO ACCEPTABLE METHODSZ	SucceededzGeneral SOCKS server failurez!Connection not allowed by rulesets   zNetwork unreachables   zHost unreachables   zConnection refuseds   zTTL expireds   zCommand not supporteds   zAddress type not supportedauthc          
     s,    V ^8  d   QhRRRRRRRRR	R
/# )   streamr   hostZbytesportintr   tuple[bytes, bytes] | NonereturnNone Zformat   "?/usr/lib/python3.14/site-packages/httpcore/_sync/socks_proxy.py__annotate__r    *   sC     <K <K<K <K 	<K
 %<K 
<K    c               s   \         P                  P                  4       pVf%   \         P                  P                  P                  M#\         P                  P                  P
                  pVP                  \         P                  P                  V.4      4       VP                  4       pV P                  V4       V P                  RR7      pVP                  V4      p\        V\         P                  P                  4      '       g   Q hVP                  V8w  dI   \        P!                  VR4      p	\        P!                  VP                  R4      p
\#        RV	 RV
 R24      hVP                  \         P                  P                  P
                  8X  d   Vf   Q hVw  rVP                  \         P                  P%                  W4      4       VP                  4       pV P                  V4       V P                  RR7      pVP                  V4      p\        V\         P                  P&                  4      '       g   Q hVP(                  '       g   \#        R4      hVP                  \         P                  P*                  P-                  \         P                  P.                  P0                  W34      4       VP                  4       pV P                  V4       V P                  RR7      pVP                  V4      p\        V\         P                  P2                  4      '       g   Q hVP4                  \         P                  P6                  P8                  8w  d0   \:        P!                  VP4                  R4      p\#        R	V R24      hR # )
Ni   )Z	max_bytesZUNKNOWNz
Requested z from proxy server, but got Z.zInvalid username/passwordZUNKOWNz Proxy Server could not connect: )socksioZsocks5ZSOCKS5ConnectionZSOCKS5AuthMethodZNO_AUTH_REQUIREDZUSERNAME_PASSWORDZsendZSOCKS5AuthMethodsRequestZdata_to_sendZwriteZreadZreceive_dataZ
isinstanceZSOCKS5AuthReplyZmethodAUTH_METHODSgetr   ZSOCKS5UsernamePasswordRequestZSOCKS5UsernamePasswordReplyZsuccessZSOCKS5CommandRequestZfrom_addressZSOCKS5CommandZCONNECTZSOCKS5Reply
reply_codeZSOCKS5ReplyCodeZ	SUCCEEDEDREPLY_CODES)r   r   r   r   ZconnZauth_methodZoutgoing_bytesZincoming_bytesZresponseZ	requestedZ	respondedusernamepasswordr%   s   &$$$          r   _init_socks5_connectionr)   *   s    >>**,D
 < 	''88^^,,>> 
 	IIgnn55{mDE&&(N
LL  [[4[0N  0Hh > >????+% $$[)<	 $$X__i@	#?	{!L
 	
 '..99KKK!		'..>>xRS**,^$  t4$$^4(GNN$N$NOOOO899 	II++88NN((004,	

 &&(N
LL  [[4[0N  0Hh : :;;;;gnn<<FFF __X%8%8(C
;J<qIJJ Gr!   c                  sB   a  ] tR t^itRtRR V 3R llltR R ltRtV ;t# )
SOCKSProxyz:
A connection pool that sends requests via an HTTP proxy.
c               sD    V ^8  d   QhRRRRRRRRR	RR
RRRRRRRRRRR/# )r   	proxy_urlzURL | bytes | str
proxy_authz&tuple[bytes | str, bytes | str] | Nonessl_contextssl.SSLContext | Nonemax_connectionsz
int | Nonemax_keepalive_connectionskeepalive_expiryfloat | Nonehttp1boolhttp2retriesr   network_backendNetworkBackend | Noner   r   r   r   r   r   r    SOCKSProxy.__annotate__n   s     @$ @$$@$ ;@$ +	@$
 $@$ $.@$ '@$ @$ @$ @$ /@$ 
@$r!   c                s   < \         SV `  VVVVVVV
V	R7       W0n        \        VRR7      V n        Ve*   Vw  r\        VRR7      p\        VRR7      pVV3V n        R# RV n        R# )aF  
A connection pool for making HTTP requests.

Parameters:
    proxy_url: The URL to use when connecting to the proxy server.
        For example `"http://127.0.0.1:8080/"`.
    ssl_context: An SSL context to use for verifying connections.
        If not specified, the default `httpcore.default_ssl_context()`
        will be used.
    max_connections: The maximum number of concurrent HTTP connections that
        the pool should allow. Any attempt to send a request on a pool that
        would exceed this amount will block until a connection is available.
    max_keepalive_connections: The maximum number of idle HTTP connections
        that will be maintained in the pool.
    keepalive_expiry: The duration in seconds that an idle HTTP connection
        may be maintained for before being expired from the pool.
    http1: A boolean indicating if HTTP/1.1 requests should be supported
        by the connection pool. Defaults to True.
    http2: A boolean indicating if HTTP/2 requests should be supported by
        the connection pool. Defaults to False.
    retries: The maximum number of retries when trying to establish
        a connection.
    local_address: Local address to connect from. Can also be used to
        connect using a particular address family. Using
        `local_address="0.0.0.0"` will connect using an `AF_INET` address
        (IPv4), while using `local_address="::"` will connect using an
        `AF_INET6` address (IPv6).
    uds: Path to a Unix Domain Socket to use instead of TCP sockets.
    network_backend: A backend instance to use for handling network I/O.
)r-   r/   r0   r1   r3   r5   r7   r6   r+   )ZnameNr,   )Zsuper__init___ssl_contextr   
_proxy_urlr   _proxy_auth)selfr+   r,   r-   r/   r0   r1   r3   r5   r6   r7   r'   r(   Zusername_bytesZpassword_bytes	__class__s   &&&&&&&&&&&    r   r:   ZSOCKSProxy.__init__n   s    V 	#+&?-+ 	 		
 (%ikB!!+H*8,GN*8,GN<D
  $Dr!   c                    V ^8  d   QhRRRR/# )r   originr   r   r   r   r   r   r   r    r9      s     

 

 

3F 

r!   c                	s    \        V P                  P                  VV P                  V P                  V P
                  V P                  V P                  V P                  R 7      # ))proxy_originremote_originr,   r-   r1   r3   r5   r7   )	Socks5Connectionr<   rA   r=   r;   _keepalive_expiry_http1_http2_network_backendr>   rA      &&r   create_connectionZSOCKSProxy.create_connection   sQ    // ''))!33++++ 11	
 		
r!   )r=   r<   r;   )	NNi
   NNTFr    N)	__name__
__module____qualname____firstlineno__Z__doc__r:   rK   __static_attributes__Z__classcell__)r?   s   @r   r*   r*   i   s    @$ @$D

 

r!   r*   c                  s    ] tR t^tRR R lltR R ltR R ltR R	 ltR
 R ltR R lt	R R lt
R R ltR R ltR R ltRtR# )rD   Nc               s<    V ^8  d   QhRRRRRRRRRR	R
RRRRRRR/	# )r   rB   r   rC   r,   r   r-   r.   r1   r2   r3   r4   r5   r7   r8   r   r   r   r   r   r   r    Socks5Connection.__annotate__   sd     % %% % /	%
 +% '% % % /% 
%r!   c	                	s    Wn         W n        W0n        W@n        WPn        W`n        Wpn        Vf   \        4       MTV n        \        4       V n
        R V n        RV n        R # )NF)_proxy_origin_remote_originr=   r;   rE   rF   rG   r   rH   r   _connect_lock_connection_connect_failed)	r>   rB   rC   r,   r-   r1   r3   r5   r7   s	   &&&&&&&&&r   r:   ZSocks5Connection.__init__   s^     *+%'!1 -4KM/ 	 "V7;$r!   c               r@   )r   requestr	   r   r
   r   r   r   r   r    rQ      s     S8 S8g S8( S8r!   c           
     	s`   VP                   P                  R / 4      pVP                   P                  RR4      pVP                  RR4      pV P                  ;_uu_ 4        V P                  Ef    RV P                  P
                  P                  R4      RV P                  P                  R V/p\        R\        W4      ;_uu_ 4       pV P                  P                  ! R/ VB pWvn        RRR4       RXRV P                  P
                  P                  R4      RV P                  P                  R	V P                  /p\        R
\        W4      ;_uu_ 4       p\        R/ VB  Wvn        RRR4       V P                  P                   R8X  d   V P"                  f   \%        4       MV P"                  pV P&                  '       d   RR.MR.p	VP)                  V	4       RTRT;'       g&    V P                  P
                  P                  R4      R V/p\        R\        W4      ;_uu_ 4       pVP*                  ! R/ VB pWvn        RRR4       VP-                  R4      p
V
RJ;'       d    V
P/                  4       R8H  pV'       g%   V P&                  '       d>   V P0                  '       g,   ^RIHp V! V P                  VV P6                  R7      V n        MR\9        V P                  VV P6                  R7      V n        M*V P                  P?                  4       '       g   \A        4       hRRR4       V P                  PC                  V4      #   + '       g   i     ELc; i  + '       g   i     EL; i  + '       g   i     EL5; i  \:         d   pRT n        ThRp?ii ; i  + '       g   i     L; i)timeoutsni_hostnameNZconnectr   Zasciir   connect_tcpr   r   Zsetup_socks5_connection   httpszhttp/1.1Zh2r-   Zserver_hostname	start_tls
ssl_object)HTTP2Connection)rA   r   r1   Tr   )"Z
extensionsr$   rT   rU   rR   r   Zdecoder   r   loggerrH   rZ   Zreturn_valuerS   r=   r)   schemer;   r   rG   Zset_alpn_protocolsr\   Zget_extra_infoZselected_alpn_protocolrF   r5   r^   rE   r   Z	ExceptionrV   is_availabler   handle_request)r>   rW   ZtimeoutsrY   rX   ZkwargsZtracer   r-   Zalpn_protocolsr]   Zhttp2_negotiatedr^   Zexcs   &&            r   rb   ZSocks5Connection.handle_request   sK   %%)))R8))--ndC,,y$/'H  2 2 7 7 > >w G 2 2 7 7!7F
 }fgFF%!%!6!6!B!B!LV!L-3* G !& 3 3 8 8 ? ? H 3 3 8 8 0 0	F 167 /9&9-3*	 **11X=  $008 01!%!2!2 $ 37+++Z.J< ' $66~F *;-| 0H 0H#2277>>wG%w	" #;HHE%+%5%5%?%?F17. I
 "(!6!6|!DJ"$. H H&==?4G % (DKKK:+:#'#6#6#)-1-C-C,( ,<#'#6#6#)-1-C-C,( %%2244,..Y  \ ..w77K GFF  0 IHH8 ! +/D(IQ  s   N0AN#M	+A,NM	)AN#N&AN(M-	#N%NNN%*NN'N7 N
NM	NM*$	N-M>8	NN	NNNN-	c               r@   )r   rA   r   r   r4   r   r   r   r   r    rQ   -  s     - - -D -r!   c                	s    WP                   8H  # N)rS   rI   rJ   r   can_handle_requestZ#Socks5Connection.can_handle_request-  s    ,,,,r!   c                   V ^8  d   QhRR/# )r   r   r   r   r   r   r   r    rQ   0  s     % %t %r!   c                	sZ    V P                   e   V P                   P                  4        R # R # rc   )rU   closer>      &r   rf   ZSocks5Connection.close0  s%    '""$ (r!   c               re   r   r   r4   r   r   r   r   r    rQ   4  s     
/ 
/d 
/r!   c                	s   V P                   f`   V P                  ;'       dL    V P                  P                  R8H  ;'       g    V P                  '       * ;'       d    V P
                  '       * # V P                   P                  4       # )Nr[   )rU   rG   rS   r`   rF   rV   ra   rg   rh   r   ra   ZSocks5Connection.is_available4  su    #
  - -((//8;NN4;;- -,,,
 ,,..r!   c               re   ri   r   r   r   r   r    rQ   @  s     . .T .r!   c                	j    V P                   f   V P                  # V P                   P                  4       # rc   )rU   rV   has_expiredrg   rh   r   rk   ZSocks5Connection.has_expired@  s/    #'''++--r!   c               re   ri   r   r   r   r   r    rQ   E  s     * * *r!   c                	rj   rc   )rU   rV   is_idlerg   rh   r   rl   ZSocks5Connection.is_idleE  s/    #'''''))r!   c               re   ri   r   r   r   r   r    rQ   J  s     , ,4 ,r!   c                	rj   rc   )rU   rV   	is_closedrg   rh   r   rm   ZSocks5Connection.is_closedJ  s/    #'''))++r!   c               re   r   r   Zstrr   r   r   r   r    rQ   O  s     ' 'c 'r!   c                	s~    V P                   f   V P                  '       d   R# R# V P                   P                  4       # )NzCONNECTION FAILEDZ
CONNECTING)rU   rV   inforg   rh   r   ro   ZSocks5Connection.infoO  s:    #*.*>*>*>&PLP$$&&r!   c               re   rn   r   r   r   r   r    rQ   T  s     > ># >r!   c                	sX    R V P                   P                   RV P                  4        R2# )Z<z [z]>)r?   rL   ro   rg   rh   r   __repr__ZSocks5Connection.__repr__T  s(    4>>**+2diik]"==r!   )rV   rT   rU   rF   rG   rE   rH   r=   rR   rS   r;   )NNNTFN)rL   rM   rN   rO   r:   rb   rd   rf   ra   rk   rl   rm   ro   rp   rP   r   r!   r   rD   rD      s;    %4S8j-%
/.
*
,
'
> >r!   rD   )'Z
__future__r   ZloggingZsslr"   Z_backends.syncr   Z_backends.baser   r   Z_exceptionsr   r   Z_modelsr   r   r	   r
   r   r   Z_sslr   Z_synchronizationr   Z_tracer   Zconnection_poolr   Zhttp11r   Z
interfacesr   Z	getLoggerr_   r#   r&   r)   r*   rD   r   r!   r   <module>rq      s    "  
  ( : < P P & #  + $ +			+	, )X $	 [+0"!]$)
<K
 (,<K~Q
 Q
hX>* X>r!   