a Y3@s$dZddlmZz ddlZWn4eyPddlZddlmZedeYn0ddl m Z m Z ddlmZmZdd lmZmZdd lmZmZdd lmZdd lmZz ddlZWneydZYn0Gd ddeZGdddeeZGdddeZGdddeZGdddeZdS)a This 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. The SOCKS implementation supports the full range of urllib3 features. It also supports the following SOCKS features: - SOCKS4 - SOCKS4a - SOCKS5 - Usernames and passwords for the SOCKS proxy Known Limitations: - Currently PySocks does not support contacting remote websites via literal IPv6 addresses. Any such connection attempt will fail. You must use a domain name. - Currently PySocks does not support IPv6 connections to the SOCKS proxy. Any such connection attempt will fail. )absolute_importN)DependencyWarningzSOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks. For more information, see https://urllib3.readthedocs.io/en/latest/contrib.html#socks-proxies)errortimeout)HTTPConnectionHTTPSConnection)HTTPConnectionPoolHTTPSConnectionPool)ConnectTimeoutErrorNewConnectionError) PoolManager) parse_urlcs(eZdZdZfddZddZZS)SOCKSConnectionzG A plain-text HTTP connection that connects via a SOCKS proxy. cs&|d|_tt|j|i|dS)N_socks_options)poprsuperr__init__)selfargskwargs __class__N/Users/ymaher/Downloads/lambdas_org/requests/packages/urllib3/contrib/socks.pyr?s zSOCKSConnection.__init__c Cs^i}|jr|j|d<|jr$|j|d<zTtj|j|jff|jd|jd|jd|jd|jd|jd|jd |}Wnty}z"t |d |j|jfWYd }~nd }~0tj y&}zZ|j r|j }t |trt |d |j|jfnt |d |nt |d |WYd }~n     zSOCKSProxyManager.__init__)NNr<N) r0r1r2r3r6r8r@rr4rrrrr9sr9) r3 __future__rr$ ImportErrorwarnings exceptionsrwarnsocketrr+rr( connectionrrconnectionpoolr r r r poolmanagerr Zutil.urlrsslrr5r6r8r9rrrrs4         F