qBittorrent
nova3.socks Namespace Reference

Classes

class  ProxyError
 
class  GeneralProxyError
 
class  Socks5AuthError
 
class  Socks5Error
 
class  Socks4Error
 
class  HTTPError
 
class  socksocket
 

Functions

def setdefaultproxy (proxytype=None, addr=None, port=None, rdns=True, username=None, password=None)
 

Variables

int PROXY_TYPE_SOCKS4 = 1
 
int PROXY_TYPE_SOCKS5 = 2
 
int PROXY_TYPE_HTTP = 3
 
 _defaultproxy = None
 
 _orgsocket = socket.socket
 
tuple _generalerrors
 
tuple _socks5errors
 
tuple _socks5autherrors
 
tuple _socks4errors
 

Detailed Description

SocksiPy - Python SOCKS module.
Version 1.01

Copyright 2006 Dan-Haim. All rights reserved.
Various fixes by Christophe DUMEZ <[email protected]> - 2010

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.

Function Documentation

◆ setdefaultproxy()

def nova3.socks.setdefaultproxy (   proxytype = None,
  addr = None,
  port = None,
  rdns = True,
  username = None,
  password = None 
)
setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
Sets a default proxy which all further socksocket objects will use,
unless explicitly changed.

Definition at line 110 of file socks.py.

110 def setdefaultproxy(proxytype=None,addr=None,port=None,rdns=True,username=None,password=None):
111  """setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
112  Sets a default proxy which all further socksocket objects will use,
113  unless explicitly changed.
114  """
115  global _defaultproxy
116  _defaultproxy = (proxytype,addr,port,rdns,username,password)
117 
def setdefaultproxy(proxytype=None, addr=None, port=None, rdns=True, username=None, password=None)
Definition: socks.py:110

Variable Documentation

◆ _defaultproxy

nova3.socks._defaultproxy = None
private

Definition at line 41 of file socks.py.

◆ _generalerrors

tuple nova3.socks._generalerrors
private
Initial value:
1 = ("success",
2  "invalid data",
3  "not connected",
4  "not available",
5  "bad proxy type",
6  "bad input")

Definition at line 80 of file socks.py.

◆ _orgsocket

nova3.socks._orgsocket = socket.socket
private

Definition at line 42 of file socks.py.

◆ _socks4errors

tuple nova3.socks._socks4errors
private
Initial value:
1 = ("request granted",
2  "request rejected or failed",
3  "request rejected because SOCKS server cannot connect to identd on the client",
4  "request rejected because the client program and identd report different user-ids",
5  "unknown error")

Definition at line 104 of file socks.py.

◆ _socks5autherrors

tuple nova3.socks._socks5autherrors
private
Initial value:
1 = ("succeeded",
2  "authentication is required",
3  "all offered authentication methods were rejected",
4  "unknown username or invalid password",
5  "unknown error")

Definition at line 98 of file socks.py.

◆ _socks5errors

tuple nova3.socks._socks5errors
private
Initial value:
1 = ("succeeded",
2  "general SOCKS server failure",
3  "connection not allowed by ruleset",
4  "Network unreachable",
5  "Host unreachable",
6  "Connection refused",
7  "TTL expired",
8  "Command not supported",
9  "Address type not supported",
10  "Unknown error")

Definition at line 87 of file socks.py.

◆ PROXY_TYPE_HTTP

int nova3.socks.PROXY_TYPE_HTTP = 3

Definition at line 39 of file socks.py.

◆ PROXY_TYPE_SOCKS4

int nova3.socks.PROXY_TYPE_SOCKS4 = 1

Definition at line 37 of file socks.py.

◆ PROXY_TYPE_SOCKS5

int nova3.socks.PROXY_TYPE_SOCKS5 = 2

Definition at line 38 of file socks.py.