관리-도구
편집 파일: socks.cpython-311.pyc
� N�Dg� � � � d Z ddlmZ ddlZn%# e$ r ddlZddlmZ ej de� � � w xY wddl m Z ddl mZ dd lmZmZ dd lmZmZ ddlmZmZ ddlmZ dd lmZ ddlZn # e$ r dZY nw xY w G d� de� � Z G d� dee� � Z G d� de� � Z G d� de� � Z G d� de� � ZdS )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 �( � � e Zd ZdZ� fd�Zd� Z� xZS )�SOCKSConnectionzG A plain-text HTTP connection that connects via a SOCKS proxy. c �| �� |� d� � | _ t t | � � j |i |�� d S )N�_socks_options)�popr �superr �__init__)�self�args�kwargs� __class__s ��u/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/urllib3/contrib/socks.pyr zSOCKSConnection.__init__P s@ �� �$�j�j�)9�:�:���-��o�t�$�$�-�t�>�v�>�>�>�>�>� c �� � i }| j r | j |d<