Socks5 module

socks5man.socks5

This module contains the Socks5 class. It is used as a wrapper to contain socks5 server information. The wrapper allows you to verify if a socks5 server is operational, calculate an approximate bandwidth, calculate an approximate connection time, and retrieve all stored server information through properties.

class socks5man.socks5.Socks5(db_socks5)

Socks5 wrapper class. Retrieve info and verify if socks is operational. Object is initialized with a socks5 database object by the manager class.

verify()

Test if this socks5 can be connected to and retrieve its own IP through the configured IP api. Automatically updates the ‘operational’ value in the database

Returns:True if server is operational, false otherwise
Return type:bool
approx_bandwidth()

Calculate an approximate Mbit/s download speed using the file specified in the config to download. Automatically updated in the database

Returns:An approximate download speed in Mbit/s
Return type:float
measure_connection_time()

Measure the time it takes to connect to the specified connection test URL in the config. Result is automatically stored in the database

Returns:An approximate connection time in seconds
Return type:float
to_dict()

Dump the underlying database object to a dictionary

Returns:A dictionary containing all database values
Return type:dict
id

The server id

Return type:int
host

The server hostname/IP

Return type:str
port

The server port

Return type:int
country

The country the server resides in

Return type:str
country_code

The (ISO 3166-1 alpha-2) country code of the country the server resides in

Return type:str
city

The city the server resides in

Return type:str
username

The username for this server

Return type:str
password

The password for this server

Return type:str
added_on

The date and time this server was added

Return type:DateTime
last_use

The date and time this server was last acquired/used. This field is updated when a server is acquired by Manager().acquire()

Return type:DateTime
last_check

The date and time this server’s operationality was last checked

Return type:DateTime
operational

Boolean that tells if the last operationality check was successful or not.

Return type:bool
bandwidth

Approximate bandwidth down in Mbit/s. The bandwidth check is only performed if it is enabled in the socks5man.conf

Return type:float
connect_time

The approximate connection time in seconds

Return type:float
description

The description of this server

Return type:str