Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
odigos / etc / odigos-vmagent / instrumentations / python / urllib3 / contrib / __pycache__ / socks.cpython-311.pyc
Size: Mime:
§

€QÄg}ãó¢—dZddlmZ	ddlZn%#e$rddlZddlmZejde¦«‚wxYwddl	Z	ddl
mZddl
mZmZdd	lmZmZdd
lmZmZddlmZddlmZ	ddlZn
#e$rdZYnwxYwGd
„de	j¦«ZGd„de¦«ZGd„dee¦«ZGd„de¦«ZGd„de¦«ZGd„de¦«Z dS)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"

é)ÚannotationsNé)ÚDependencyWarningzÉSOCKS 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)ÚHTTPConnectionÚHTTPSConnection)ÚHTTPConnectionPoolÚHTTPSConnectionPool)ÚConnectTimeoutErrorÚNewConnectionError)ÚPoolManager)Ú	parse_urlcóL—eZdZUded<ded<ded<ded<ded<ded	<d
S)Ú_TYPE_SOCKS_OPTIONSÚintÚ
socks_versionú
str | NoneÚ
proxy_hostÚ
proxy_portÚusernameÚpasswordÚboolÚrdnsN)Ú__name__Ú
__module__Ú__qualname__Ú__annotations__©óú</tmp/pip-target-0z7lll2b/lib/python/urllib3/contrib/socks.pyrrKsU€€€€€€ØÐÐÑØÐÐÑØÐÐÑØÐÐÑØÐÐÑØ€J€JJ€J€Jrrcó,‡—eZdZdZdˆfd	„Zd
d„ZˆxZS)ÚSOCKSConnectionzG
    A plain-text HTTP connection that connects via a SOCKS proxy.
    Ú_socks_optionsrÚargsú
typing.AnyÚkwargsÚreturnÚNonecóH•—||_t¦«j|i|¤ŽdS)N)r#ÚsuperÚ__init__)Úselfr#r$r&Ú	__class__s    €r r+zSOCKSConnection.__init__Ys/ø€ð-ˆÔ؍‰ŒÔ˜$Ð) &Ð)Ð)Ð)Ð)Ð)rúsocks.socksocketcóÒ—i}|jr
|j|d<|jr
|j|d<	tj|j|jff|jd|jd|jd|jd|jd|jd|jd	œ|¤Ž}nÓ#t$r'}t|d
|j›d|j›d¦«|‚d
}~wtj
$rq}|jrQ|j}t|t¦«r"t|d
|j›d|j›d¦«|‚t|d|›¦«‚t|d|›¦«|‚d
}~wt$r}t|d|›¦«|‚d
}~wwxYw|S)zA
        Establish a new connection via the SOCKS proxy.
        Úsource_addressÚsocket_optionsrrrrrr)Ú
proxy_typeÚ
proxy_addrrÚproxy_usernameÚproxy_passwordÚ
proxy_rdnsrzConnection to z timed out. (connect timeout=ú)Nz&Failed to establish a new connection: )r0r1ÚsocksÚcreate_connectionÚhostÚportr#rÚ
SocketTimeoutrÚ
ProxyErrorÚ
socket_errÚ
isinstancerÚOSError)r,Úextra_kwÚconnÚeÚerrors     r Ú	_new_connzSOCKSConnection._new_connbs€ð+-ˆØÔð	=Ø)-Ô)<ˆHÐ%Ñ&àÔð	=Ø)-Ô)<ˆHÐ%Ñ&ð+	ÝÔ*Ø”˜DœIÐ&ð
àÔ.¨Ô?ØÔ.¨|Ô<ØÔ.¨|Ô<Ø#Ô2°:Ô>Ø#Ô2°:Ô>ØÔ.¨vÔ6Øœð
ð
ðð
ð
ˆDˆDøõð	ð	ð	Ý%ØØX ¤ÐXÐXÈÌÐXÐXÐXñôðð
øøøøõ
Ôð	ð	ð	ðŒ|ð
ØœÝ˜e¥]Ñ3Ô3ð
Ý-ØØ`¨¬Ð`Ð`ÐQUÔQ]Ð`Ð`Ð`ñôððõ-ØÐNÀuÐNÐNñôðõ)ØÐFÀ1ÐFÐFñôàðøøøøõð	ð	ð	Ý$ØÐB¸qÐBÐBñôàð
øøøøð	øøøð
ˆs1¦A-BÂ
E$Â"CÃE$ÃA,D>Ä>
E$ÅEÅE$)r#rr$r%r&r%r'r()r'r.)rrrÚ__doc__r+rEÚ
__classcell__©r-s@r r"r"Ts[ø€€€€€ððð*ð*ð*ð*ð*ð*ð8ð8ð8ð8ð8ð8ð8ð8rr"có—eZdZdS)ÚSOCKSHTTPSConnectionN)rrrrrr rJrJ¡s€€€€€Ø€DrrJcó—eZdZeZdS)ÚSOCKSHTTPConnectionPoolN)rrrr"Ú
ConnectionClsrrr rLrL¥s€€€€€Ø#€M€M€MrrLcó—eZdZeZdS)ÚSOCKSHTTPSConnectionPoolN)rrrrJrMrrr rOrO©s€€€€€Ø(€M€M€MrrOcó8‡—eZdZdZeedœZ				ddˆfd„
ZˆxZS)ÚSOCKSProxyManagerzh
    A version of the urllib3 ProxyManager that routes connections via the
    defined SOCKS proxy.
    )ÚhttpÚhttpsNé
Ú	proxy_urlÚstrrrrÚ	num_poolsrÚheadersútyping.Mapping[str, str] | NoneÚconnection_pool_kwr%có*•—t|¦«}|€;|€9|j2|j d¦«}t|¦«dkr|\}}|jdkrt
j}	d}
n`|jdkrt
j}	d}
nF|jdkrt
j}	d}
n,|jdkrt
j}	d}
ntd	|›¦«‚||_	|	|j
|j|||
d
œ}||d<t¦«j
||fi|¤Žtj|_dS)Nú:rÚsocks5FÚsocks5hTÚsocks4Úsocks4az'Unable to determine SOCKS version from )rrrrrrr#)rÚauthÚsplitÚlenÚschemer8ÚPROXY_TYPE_SOCKS5ÚPROXY_TYPE_SOCKS4Ú
ValueErrorrUr:r;r*r+rQÚpool_classes_by_scheme)
r,rUrrrWrXrZÚparsedrbrrÚ
socks_optionsr-s
            €r r+zSOCKSProxyManager.__init__¸sEø€õ˜9Ñ%Ô%ˆàРР0°V´[Ð5LØ”K×%Ò% cÑ*Ô*ˆEݐ5‰zŒz˜QŠˆØ%*Ñ"˜(ØŒ=˜HÒ$Ð$Ý!Ô3ˆM؈DˆDØ
Œ]˜iÒ
'Ð
'Ý!Ô3ˆM؈DˆDØ
Œ]˜hÒ
&Ð
&Ý!Ô3ˆM؈DˆDØ
Œ]˜iÒ
'Ð
'Ý!Ô3ˆM؈DˆDåÐRÀyÐRÐRÑSÔSÐSà"ˆŒð+Ø œ+Ø œ+Ø Ø Øð

ð
ˆ
ð0=ÐÐ+Ñ,à‰ŒÔ˜ GÐBÐBÐ/AÐBÐBÐBå&7Ô&NˆÔ#Ð#Ð#r)NNrTN)rUrVrrrrrWrrXrYrZr%)	rrrrFrLrOrhr+rGrHs@r rQrQ­szø€€€€€ððð(Ø)ððÐð $Ø#ØØ37ð
,Oð,Oð,Oð,Oð,Oð,Oð,Oð,Oð,Oð,Oð,OrrQ)!rFÚ
__future__rr8ÚImportErrorÚwarningsÚ
exceptionsrÚwarnÚtypingÚsocketrr<Ú
connectionrrÚconnectionpoolr	r
rrÚpoolmanagerr
Úutil.urlrÚsslÚ	TypedDictrr"rJrLrOrQrrr ú<module>rxsmðð&ð&ðP#Ð"Ð"Ð"Ð"Ð"ð
Ø€L€L€L€LøØð

ð

ð

Ø€O€O€Oà.Ð.Ð.Ð.Ð.Ð.à€H„Mð
Yð	ñ
ôðð
ð

øøøð€
€
€
Ø+Ð+Ð+Ð+Ð+Ð+à8Ð8Ð8Ð8Ð8Ð8Ð8Ð8ØDÐDÐDÐDÐDÐDÐDÐDØ@Ð@Ð@Ð@Ð@Ð@Ð@Ð@Ø%Ð%Ð%Ð%Ð%Ð%Ø Ð Ð Ð Ð Ð ðØ€J€J€J€JøØðððØ
€C€C€Cðøøøððððð˜&Ô*ñôððFðFðFðFðFnñFôFðFðZ	ð	ð	ð	ð	˜?¨Oñ	ô	ð	ð$ð$ð$ð$ð$Ð0ñ$ô$ð$ð)ð)ð)ð)ð)Ð2ñ)ô)ð)ð7Oð7Oð7Oð7Oð7O˜ñ7Oô7Oð7Oð7Oð7OsŠ"1Á#A(Á(A2Á1A2