/opt/support/venv/lib/python3.13/site-packages/urllib3/contrib/__pycache__
Edit: /opt/support/venv/lib/python3.13/site-packages/urllib3/contrib/__pycache__/socks.cpython-313.pyc (8390B)
i{ S r SSKJr SSKrSSK r SSK
Jr SSK
JrJr SS KJrJr SS
KJrJr SSKJr SSKJr SSKr " S
S\ R4 5 r " S S\5 r " S S\\5 r " S S\5 r " S S\5 r " S S\5 r g! \ a SSKrSSKJr \R " S\5 e f = f! \ a Sr Nf = f)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://
@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://:@proxy-host"
)annotationsN )DependencyWarningzSOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#socks-proxies)timeout)HTTPConnectionHTTPSConnection)HTTPConnectionPoolHTTPSConnectionPool)ConnectTimeoutErrorNewConnectionError)PoolManager) parse_urlc R \ rS rSr% S\S' S\S' S\S' S\S' S\S' S \S
' Srg)
_TYPE_SOCKS_OPTIONSK int
socks_version
str | None
proxy_host
proxy_portusernamepasswordboolrdns N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r G/opt/support/venv/lib/python3.13/site-packages/urllib3/contrib/socks.pyr r K s%
Jr" r c J ^ \ rS rSrSr SU 4S jjrSS jrSrU =r$ )SOCKSConnectionT z?
A plain-text HTTP connection that connects via a SOCKS proxy.
c 2 > Xl [ TU ] " U0 UD6 g )N)_socks_optionssuper__init__)selfr( argskwargs __class__s r# r* SOCKSConnection.__init__Y s -
$)&)r" c t 0 nU R ( a U R US' U R ( a U R US' [ R " U R U R
44U R S U R S U R S U R S U R S U R S U R S .UD6nU$ ! [ a- n[ U S
U R SU R S35 UeS
nAf[ R a~ nUR ( aX UR n[ U[ 5 ( a( [ U S
U R SU R S35 Ue[ U SU 35 e[ U SU 35 UeS
nAf[ a n[ U SU 35 UeS
nAff = f)z1
Establish a new connection via the SOCKS proxy.
source_addresssocket_optionsr r r r r r )
proxy_type
proxy_addrr proxy_usernameproxy_password
proxy_rdnsr zConnection to z timed out. (connect timeout=)Nz&Failed to establish a new connection: )r1 r2 sockscreate_connectionhostportr( r
SocketTimeoutr
ProxyError
socket_err
isinstancer OSError)r+ extra_kwconneerrors r# _new_connSOCKSConnection._new_connb s +-)-)<)#22:>..v6
DX A % +HVWX
||e]33-(3PQUQ]Q]P^^_` - FugN )B1#F $>qcB
s2 B
C
F7(DF7A9F
F7"F22F7)r( )r( r r,
typing.Anyr- rH returnNone)rI zsocks.socksocket) r r r r __doc__r* rF r!
__classcell__r. s @r# r% r% T s= *+* * *
*8 8r" r% c \ rS rSrSrg)SOCKSHTTPSConnection r N)r r r r r! r r" r# rO rO s r" rO c \ rS rSr\rSrg)SOCKSHTTPConnectionPool r N)r r r r r%
ConnectionClsr! r r" r# rR rR s #Mr" rR c \ rS rSr\rSrg)SOCKSHTTPSConnectionPool r N)r r r r rO rT r! r r" r# rV rV s (Mr" rV c \ ^ \ rS rSrSr\\S.r S SU 4S jjjrSr U =r
$ )SOCKSProxyManager z\
A version of the urllib3 ProxyManager that routes connections via the
defined SOCKS proxy.
)httphttpsc l > [ U5 nUc> Uc; UR b. UR R S5 n[ U5 S:X a Uu p#UR S:X a [
R n Sn
OwUR S:X a [
R n Sn
OTUR S:X a [
R n Sn
O1UR S:X a [
R n Sn
O[ S U 35 eXl U UR UR UUU
S
.nXS' [ TU ]4 " XE40 UD6 [ R U l g )N:r socks5Fsocks5hTsocks4socks4az'Unable to determine SOCKS version from )r r r r r r r( )r authsplitlenschemer9 PROXY_TYPE_SOCKS5PROXY_TYPE_SOCKS4
ValueError proxy_urlr; r<