Update to v0.4.1
This commit is contained in:
@@ -28,12 +28,13 @@ except:
|
||||
if sys.platform.startswith('linux'):
|
||||
print('Please install it with: sudo apt-get install python-socksipy' + Fore.RESET)
|
||||
else:
|
||||
print('You can download it from http://socksipy.sourceforge.net/' + Fore.RESET)
|
||||
print('You can download it from https://code.google.com/p/socksipy-branch/' + Fore.RESET)
|
||||
sys.exit(-2)
|
||||
|
||||
class Privoxy:
|
||||
def __init__(self, port=8118):
|
||||
self.__port = port
|
||||
Request.timeout = 20
|
||||
|
||||
def start_daemon(self):
|
||||
if sys.platform.startswith('linux'):
|
||||
@@ -49,10 +50,11 @@ class Privoxy:
|
||||
def connect(self):
|
||||
print('\nChecking connection...')
|
||||
socks.setdefaultproxy(socks.PROXY_TYPE_HTTP, '127.0.0.1', self.__port, True)
|
||||
socks.socket.setdefaulttimeout(20)
|
||||
socket.socket = socks.socksocket
|
||||
try:
|
||||
request = Request.get_request('https://check.torproject.org/')
|
||||
response = request[1]
|
||||
response = str(request[0])
|
||||
except:
|
||||
print('Failed to connect through Privoxy!')
|
||||
print('Please make sure your configuration is right!\n')
|
||||
@@ -73,4 +75,4 @@ class Privoxy:
|
||||
os.system('service privoxy stop')
|
||||
print('[ ok ] Stopping privoxy daemon...done.')
|
||||
elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
|
||||
print('You can close Privoxy now...')
|
||||
print('You can stop Privoxy now...')
|
||||
Reference in New Issue
Block a user