diff --git a/config.ini.sample b/config.ini.sample index 34d1e67..4626cb5 100644 --- a/config.ini.sample +++ b/config.ini.sample @@ -8,6 +8,7 @@ proxy_file = false threads = 10 timeout = 15 submit_after = 200 +use_ssl = false [proxyfind] search = true diff --git a/config.py b/config.py index ee03201..ccb254d 100644 --- a/config.py +++ b/config.py @@ -4,7 +4,7 @@ _loaded = False def load(): if _loaded: return - global database, maxfail, search, torhosts, watchd_threads, checktime, timeout, read_timeout, submit_after + global database, maxfail, search, torhosts, watchd_threads, checktime, timeout, read_timeout, submit_after, use_ssl ## read the config files parser = SafeConfigParser() @@ -19,6 +19,7 @@ def load(): watchd_threads = parser.getint('watcherd', 'threads') timeout = parser.getint('watcherd', 'timeout') submit_after = parser.getint('watcherd', 'submit_after') + use_ssl = parser.getboolean('watcherd', 'use_ssl') # allow overriding select items from the commandline import argparse diff --git a/proxywatchd.py b/proxywatchd.py index d69adb4..d419c14 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -26,6 +26,7 @@ class WorkerJob(): def connect_socket(self): srv = random.choice(config.servers).strip() protos = ['http', 'socks5', 'socks4'] if self.proto is None else [self.proto] + server_port = 6697 if config.use_ssl else 6667 for proto in protos: torhost = random.choice(config.torhosts) @@ -36,7 +37,7 @@ class WorkerJob(): ] try: - sock = rocksock.Rocksock(host=srv, port=6697, ssl=True, proxies=proxies, timeout=config.timeout) + sock = rocksock.Rocksock(host=srv, port=server_port, ssl=config.use_ssl, proxies=proxies, timeout=config.timeout) sock.connect() sock.send('%s\n' % random.choice(['NICK', 'USER', 'JOIN', 'MODE', 'PART', 'INVITE', 'KNOCK', 'WHOIS', 'WHO', 'NOTICE', 'PRIVMSG', 'PING', 'QUIT'])) return sock, proto, duration, torhost, srv, 0