$83 GRAYBYTE WORDPRESS FILE MANAGER $75

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.217.100
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/hc_python/lib/python3.12/site-packages/urllib3/contrib/__pycache__/

HOME
Current File : /opt/hc_python/lib/python3.12/site-packages/urllib3/contrib/__pycache__//socks.cpython-312.pyc
�

I��g}���dZddlmZ	ddlZddl	Z	ddl
mZddl
mZmZdd	lmZmZdd
lmZmZddlmZddlmZ	ddlZGd
�de	j4�ZGd�de�ZGd�dee�ZGd�de�ZGd�de�ZGd�de�Z y#e$rddlZddlmZejde��wxYw#e$rdZY�~wxYw)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�J�eZdZUded<ded<ded<ded<ded<ded	<y
)�_TYPE_SOCKS_OPTIONS�int�
socks_version�
str | None�
proxy_host�
proxy_port�username�password�bool�rdnsN)�__name__�
__module__�__qualname__�__annotations__���D/opt/hc_python/lib/python3.12/site-packages/urllib3/contrib/socks.pyrrKs%������������
�Jrrc�<��eZdZdZ								d�fd�Zdd�Z�xZS)�SOCKSConnectionzG
    A plain-text HTTP connection that connects via a SOCKS proxy.
    c�2��||_t�|�|i|��y)N)�_socks_options�super�__init__)�selfr$�args�kwargs�	__class__s    �r r&zSOCKSConnection.__init__Ys���-���
���$�)�&�)rc�D�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��|�d
}~wtj$rt}|jrS|j}t|t�r(t|d
|j�d|j�d��|�t|d|����t|d|���|�d
}~wt$r}t|d|���|�d
}~wwxYw)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: )r,r-�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�I�&�
��.�.��?��.�.�|�<��.�.�|�<�#�2�2�:�>�#�2�2�:�>��.�.�v�6����
��
�D�X���A�	�%�� �����+H�����VW�X���
��
���	��|�|������e�]�3�-��(�����3P�QU�Q]�Q]�P^�^_�`����-�� F�u�g�N���)��B�1�#�F������	�$��>�q�c�B���
��	�s1�BC�	F�(C9�9F�A/E>�>F�
F�F)r$rr(�
typing.Anyr)rB�return�None)rCzsocks.socksocket)rrr�__doc__r&rA�
__classcell__�r*s@r r"r"Ts8����*�+�*��*��	*�

�*�8rr"c��eZdZy)�SOCKSHTTPSConnectionN)rrrrrr rIrI�s��rrIc��eZdZeZy)�SOCKSHTTPConnectionPoolN)rrrr"�
ConnectionClsrrr rKrK�s��#�MrrKc��eZdZeZy)�SOCKSHTTPSConnectionPoolN)rrrrIrLrrr rNrN�s��(�MrrNc�N��eZdZdZeed�Z				d											d�fd�
Z�xZS)�SOCKSProxyManagerzh
    A version of the urllib3 ProxyManager that routes connections via the
    defined SOCKS proxy.
    )�http�httpsc�b��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	|����||_	|	|j|j|||
d
�}||d<t�|�4||fi|��tj|_y)N�:r�socks5F�socks5hT�socks4�socks4az'Unable to determine SOCKS version from )rrrrrrr$)r�auth�split�len�schemer4�PROXY_TYPE_SOCKS5�PROXY_TYPE_SOCKS4�
ValueError�	proxy_urlr6r7r%r&rP�pool_classes_by_scheme)
r'r`rr�	num_pools�headers�connection_pool_kw�parsedrZrr�
socks_optionsr*s
            �r r&zSOCKSProxyManager.__init__�s*����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��F�y�k�R�S�S�"���+� �+�+� �+�+� � ��

�
�0=��+�,�
����G�B�/A�B�&7�&N�&N��#r)NN�
N)r`�strrrrrrbrrcztyping.Mapping[str, str] | NonerdrB)	rrrrErKrNrar&rFrGs@r rPrP�sr����(�)��� $�#��37�
,O��,O��,O��	,O�
�,O�1�
,O�)�,O�,OrrP)!rE�
__future__rr4�ImportError�warnings�
exceptionsr�warn�typing�socketrr8�
connectionrr�connectionpoolr	r
rr�poolmanagerr
�util.urlr�ssl�	TypedDictrr"rIrKrNrPrrr �<module>rvs���&�P#�
�� �+�8�D�@�%� ���
�&�*�*��F�n�F�Z	�?�O�	�$�0�$�)�2�)�7O��7O��A�

��.��H�M�M�
Y�	�
�
�

��4��
�C��s�B�B6�$B3�6C�?C


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2025 8.03 AM
root / root
0755
__init__.cpython-312.pyc
0.164 KB
4 Apr 2025 8.03 AM
root / root
0644
pyopenssl.cpython-312.pyc
26.887 KB
4 Apr 2025 8.03 AM
root / root
0644
socks.cpython-312.pyc
7.955 KB
4 Apr 2025 8.03 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF