MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 13.59.226.183
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyc
�
r2Wc@@s�dZddlmZyddlZWn@ek
rhddlZddlmZejde��nXddl	m
ZmZ
ddlmZmZdd	lmZmZdd
lmZmZddlmZddlmZyddlZWnek
r
dZnXd
efd��YZdeefd��YZdefd��YZdefd��YZdefd��YZ dS(sK
SOCKS support for urllib3
~~~~~~~~~~~~~~~~~~~~~~~~~

This contrib module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and
SOCKS5. To enable its functionality, either install PySocks or install this
module with the ``socks`` extra.

Known Limitations:

- Currently PySocks does not support contacting remote websites via literal
  IPv6 addresses. Any such connection attempt will fail.
- Currently PySocks does not support IPv6 connections to the SOCKS proxy. Any
  such connection attempt will fail.
i(tabsolute_importNi(tDependencyWarnings�SOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks.  For more information, see https://urllib3.readthedocs.org/en/latest/contrib.html#socks-proxies(terrorttimeout(tHTTPConnectiontHTTPSConnection(tHTTPConnectionPooltHTTPSConnectionPool(tConnectTimeoutErrortNewConnectionError(tPoolManager(t	parse_urltSOCKSConnectioncB@s eZdZd�Zd�ZRS(sG
    A plain-text HTTP connection that connects via a SOCKS proxy.
    cO@s/|jd�|_tt|�j||�dS(Nt_socks_options(tpopR
tsuperRt__init__(tselftargstkwargs((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyR9scC@s�i}|jr|j|d<n|jr8|j|d<nyltj|j|jfd|jdd|jdd|jdd|jd	d
|jdd|j|�}Wn�tk
r�}t	|d
|j|jf��n�tj
k
rY}|jrC|j}t|t�r-t	|d
|j|jf��qVt
|d|��qt
|d|��n&tk
r~}t
|d|��nX|S(sA
        Establish a new connection via the SOCKS proxy.
        tsource_addresstsocket_optionst
proxy_typet
socks_versiont
proxy_addrt
proxy_hostt
proxy_porttproxy_usernametusernametproxy_passwordtpasswordRs0Connection to %s timed out. (connect timeout=%s)s(Failed to establish a new connection: %s(RRtsockstcreate_connectionthosttportR
Rt
SocketTimeoutRt
ProxyErrort
socket_errt
isinstanceR	tSocketError(Rtextra_kwtconnteR((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyt	_new_conn=sJ		





		(t__name__t
__module__t__doc__RR+(((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyR5s	tSOCKSHTTPSConnectioncB@seZRS((R,R-(((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyR/zstSOCKSHTTPConnectionPoolcB@seZeZRS((R,R-Rt
ConnectionCls(((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyR0~stSOCKSHTTPSConnectionPoolcB@seZeZRS((R,R-R/R1(((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyR2�stSOCKSProxyManagercB@s7eZdZied6ed6Zddddd�ZRS(sh
    A version of the urllib3 ProxyManager that routes connections via the
    defined SOCKS proxy.
    thttpthttpsi
c
K@s�t|�}|jdkr'tj}n+|jdkrBtj}ntd|��||_i|d6|jd6|jd6|d6|d6}	|	|d	<t	t
|�j|||�t
j|_dS(
Ntsocks5tsocks4s)Unable to determine SOCKS version from %sRRRRRR
(
RtschemeRtPROXY_TYPE_SOCKS5tPROXY_TYPE_SOCKS4t
ValueErrort	proxy_urlR!R"RR3Rtpool_classes_by_scheme(
RR<RRt	num_poolstheaderstconnection_pool_kwtparsedRt
socks_options((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyR�s$
	




N(R,R-R.R0R2R=tNoneR(((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyR3�s
(!R.t
__future__RRtImportErrortwarningst
exceptionsRtwarntsocketRR'RR#t
connectionRRtconnectionpoolRRRR	tpoolmanagerR
tutil.urlRtsslRCRR/R0R2R3(((sW/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/socks.pyt<module>s2


E

MMCT - 2023