�
Zճc�L � �j � d Z ddlZddlZddlZddlZ eedd� � � ed� � �dZdZdZ dZ
daej Z G d � d
e
� � Z G d� de� � Z G d
� de� � Z G d� de� � Z G d� de� � Z G d� de� � ZdZdZdZdZ dd�Zd� Z G d� dej � � ZdS )a SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of Dan Haim nor the names of his contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE.
This module provides a standard socket-like interface for Python
for tunneling connections through SOCKS proxies.
Minor modifications made by Christopher Gilbert (http://motomastyle.com/) for
use in PyLoris (http://pyloris.sourceforge.net/).
Minor modifications made by Mario Vilas (http://breakingcode.wordpress.com/)
mainly to merge bug fixes found in Sourceforge.
� N�socketz-socket.socket missing, proxy support unusable� � � � c � � e Zd ZdS )�
ProxyErrorN��__name__�
__module__�__qualname__� � �0/usr/lib/python3/dist-packages/httplib2/socks.pyr r 7 � � � � � � ��Dr r c � � e Zd ZdS )�GeneralProxyErrorNr
r r r r r ; r r r c � � e Zd ZdS )�Socks5AuthErrorNr
r r r r r ? r r r c � � e Zd ZdS )�Socks5ErrorNr
r r r r r C r r r c � � e Zd ZdS )�Socks4ErrorNr
r r r r r G r r r c � � e Zd ZdS )� HTTPErrorNr
r r r r r K r r r )�successzinvalid dataz
not connectedz
not availablezbad proxy typez bad input)
� succeededzgeneral SOCKS server failurez!connection not allowed by rulesetzNetwork unreachablezHost unreachablezConnection refusedzTTL expiredzCommand not supportedzAddress type not supportedz
Unknown error)r zauthentication is requiredz0all offered authentication methods were rejectedz$unknown username or invalid password�
unknown error)zrequest grantedzrequest rejected or failedzLrequest rejected because SOCKS server cannot connect to identd on the clientzPrequest rejected because the client program and identd report different user-idsr Tc � � | |||||fa dS )z�setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
Sets a default proxy which all further socksocket objects will use,
unless explicitly changed.
N)�
_defaultproxy)� proxytype�addr�port�rdns�username�passwords r �setdefaultproxyr' |