hyb
2026-01-30 44480e71b27aa9d4cb8441f50c873f1b110e9691
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Ë
ñúh¹ãó`—dZddlmZ    ddlZddl    m
Z ddl    m Z dd    lmZmZdd
lmZmZdd lmZmZdd lmZdd lmZ    ddlZGd„de«ZGd„dee«ZGd„de«ZGd„de«ZGd„de«Zy#e$rddlZddlmZejde«‚wxYw#e$rdZYŒiwxYw)a‰
This module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4, SOCKS4A (an extension of SOCKS4), and
SOCKS5. To enable its functionality, either install PySocks or install this
module with the ``socks`` extra.
 
The SOCKS implementation supports the full range of urllib3 features. It also
supports the following SOCKS features:
 
- SOCKS4A (``proxy_url='socks4a://...``)
- SOCKS4 (``proxy_url='socks4://...``)
- SOCKS5 with remote DNS (``proxy_url='socks5h://...``)
- SOCKS5 with local DNS (``proxy_url='socks5://...``)
- Usernames and passwords for the SOCKS proxy
 
.. note::
   It is recommended to use ``socks5h://`` or ``socks4a://`` schemes in
   your ``proxy_url`` to ensure that DNS resolution is done from the remote
   server instead of client-side when connecting to a domain name.
 
SOCKS4 supports IPv4 and domain names with the SOCKS4A extension. SOCKS5
supports IPv4, IPv6, and domain names.
 
When connecting to a SOCKS4 proxy the ``username`` portion of the ``proxy_url``
will be sent as the ``userid`` section of the SOCKS request:
 
.. code-block:: python
 
    proxy_url="socks4a://<userid>@proxy-host"
 
When connecting to a SOCKS5 proxy the ``username`` and ``password`` portion
of the ``proxy_url`` will be sent as the username/password to authenticate
with the proxy:
 
.. code-block:: python
 
    proxy_url="socks5h://<username>:<password>@proxy-host"
 
é)Úabsolute_importNé)ÚDependencyWarningzÂSOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks.  For more information, see https://urllib3.readthedocs.io/en/1.26.x/contrib.html#socks-proxies)Úerror)Útimeout)ÚHTTPConnectionÚHTTPSConnection)ÚHTTPConnectionPoolÚHTTPSConnectionPool)ÚConnectTimeoutErrorÚNewConnectionError)Ú PoolManager)Ú    parse_urlcó(‡—eZdZdZˆfd„Zd„ZˆxZS)ÚSOCKSConnectionzG
    A plain-text HTTP connection that connects via a SOCKS proxy.
    cóX•—|jd«|_tt||i|¤Žy)NÚ_socks_options)ÚpoprÚsuperrÚ__init__)ÚselfÚargsÚkwargsÚ    __class__s   €úTH:\Change_password\venv_build\Lib\site-packages\pip/_vendor/urllib3/contrib/socks.pyrzSOCKSConnection.__init__Ps)ø€Ø$Ÿj™jÐ)9Ó:ˆÔÜ Œo˜tÑ-¨tÐ>°vÓ>óc ó4—i}|jr|j|d<|jr|j|d<    tj|j|j
ff|j d|j d|j d|j d|j d|j d|jd    œ|¤Ž}|S#t$r(t|d
|j›d |j›d «‚tj$rr}|jrR|j}t|t«r't|d
|j›d |j›d «‚t|d |z«‚t|d |z«‚d}~wt$r}t|d |z«‚d}~wwxYw)zA
        Establish a new connection via the SOCKS proxy.
        Úsource_addressÚsocket_optionsÚ socks_versionÚ
proxy_hostÚ
proxy_portÚusernameÚpasswordÚrdns)Ú
proxy_typeÚ
proxy_addrr"Úproxy_usernameÚproxy_passwordÚ
proxy_rdnsrzConnection to z timed out. (connect timeout=ú)z(Failed to establish a new connection: %sN)rrÚsocksÚcreate_connectionÚhostÚportrrÚ SocketTimeoutr Ú
ProxyErrorÚ
socket_errÚ
isinstancer Ú SocketError)rÚextra_kwÚconnÚers     rÚ    _new_connzSOCKSConnection._new_connTs®€ðˆØ × Ò Ø)-×)<Ñ)<ˆHÐ%Ñ &à × Ò Ø)-×)<Ñ)<ˆHÐ%Ñ &ð+    Ü×*Ñ*Ø—‘˜DŸI™IÐ&ð
à×.Ñ.¨Ñ?Ø×.Ñ.¨|Ñ<Ø×.Ñ.¨|Ñ<Ø#×2Ñ2°:Ñ>Ø#×2Ñ2°:Ñ>Ø×.Ñ.¨vÑ6ØŸ ™ ñ
ðñ
ˆDðXˆ øôAò    Ü%Ùà—9“9˜dŸl›lð,óð ô ×Ñò    ð|Š|ØŸ ™ Ü˜e¤]Ô3Ü-ÙàŸ9›9 d§l£lð4óðô -ØÐHÈ5ÑPóðô)ØÐDÀqÑHóðûôò    Ü$ØÐ@À1ÑDóð ûð    ús&ºB CÃAFÄ
A-E7Å7 FÆFÆF)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rr8Ú __classcell__©rs@rrrKsø„ñô?ö8rrcó —eZdZy)ÚSOCKSHTTPSConnectionN)r9r:r;©rrr@r@“s„Ørr@có—eZdZeZy)ÚSOCKSHTTPConnectionPoolN)r9r:r;rÚ ConnectionClsrArrrCrC—s„Ø#MrrCcó—eZdZeZy)ÚSOCKSHTTPSConnectionPoolN)r9r:r;r@rDrArrrFrF›s„Ø(MrrFcó6‡—eZdZdZeedœZ                dˆfd„    ZˆxZS)ÚSOCKSProxyManagerzh
    A version of the urllib3 ProxyManager that routes connections via the
    defined SOCKS proxy.
    )ÚhttpÚhttpsc ój•—t|«}|€<|€:|j.|jjd«}t|«dk(r|\}}|jdk(rt
j }    d}
nt|jdk(rt
j }    d}
nR|jdk(rt
j}    d}
n0|jdk(rt
j}    d}
ntd    |z«‚||_    |    |j|j|||
d
œ} | |d <tt|:||fi|¤Žtj|_y) Nú:rÚsocks5FÚsocks5hTÚsocks4Úsocks4az)Unable to determine SOCKS version from %s)r r!r"r#r$r%r)rÚauthÚsplitÚlenÚschemer,ÚPROXY_TYPE_SOCKS5ÚPROXY_TYPE_SOCKS4Ú
ValueErrorÚ    proxy_urlr.r/rrHrÚpool_classes_by_scheme) rrXr#r$Ú    num_poolsÚheadersÚconnection_pool_kwÚparsedrRr r%Ú socks_optionsrs             €rrzSOCKSProxyManager.__init__ªs2ø€ô˜9Ó%ˆà Ð  Р0°V·[±[Ð5LØ—K‘K×%Ñ% cÓ*ˆEܐ5‹z˜QŠØ%*Ñ"˜(Ø =‰=˜HÒ $Ü!×3Ñ3ˆM؉DØ ]‰]˜iÒ 'Ü!×3Ñ3ˆM؉DØ ]‰]˜hÒ &Ü!×3Ñ3ˆM؉DØ ]‰]˜iÒ 'Ü!×3Ñ3ˆM؉DäÐHÈ9ÑTÓUÐ Uà"ˆŒð+Ø Ÿ+™+Ø Ÿ+™+ؠؠØñ 
ˆ ð0=ÐÐ+Ñ,ä Ô Ñ/Ø wñ    
Ø"4ò    
ô'8×&NÑ&NˆÕ#r)NNé
N)    r9r:r;r<rCrFrYrr=r>s@rrHrHŸs2ø„ñð (Ø)ñÐðØØØ÷ .Oñ.OrrH) r<Ú
__future__rr,Ú ImportErrorÚwarningsÚ
exceptionsrÚwarnÚsocketrr4rr0Ú
connectionrr    Úconnectionpoolr
r r r Ú poolmanagerrÚutil.urlrÚsslrr@rCrFrHrArrú<module>rksÇðñ&õN'ð
Ûõ (Ý+ç8ßDß@Ý%Ý ðÛô
AnôAôP    ˜?¨Oô    ô$Ð0ô$ô)Ð2ô)ô9O˜ õ9Oøðeò 
Ûå.à€H‡MMð Rð    ô ð
ð 
ûð4òØ
‚CðúsŠA<¿B#Á<$B Â#B-Â,B-