diff --git a/config.py b/config.py index d0ade8d..58b5751 100644 --- a/config.py +++ b/config.py @@ -18,7 +18,7 @@ class Config(ComboParser): self.add_item(section, 'timeout', int, 15, 'timeout for blocking operations (connect/recv/...) for proxy checks in seconds', False) self.add_item(section, 'submit_after', int, 200, 'min. number of tested proxies for DB write', False) self.add_item(section, 'debug', bool, False, 'whether to print additional debug info', False) - self.add_item(section, 'use_ssl', bool, False, 'whether to use SSL and port 6697 to connect to targets (slower)', False) + self.add_item(section, 'use_ssl', int, 0, 'whether to use SSL and port 6697 to connect to targets (slower)', False) self.add_item(section, 'checktime', int, 1800, 'base checking interval for proxies in db in seconds', False) self.add_item(section, 'perfail_checktime', int, 3600, 'additional checking interval for proxies in db in seconds per experienced failure', False) self.add_item(section, 'database', str, 'websites.sqlite', 'filename of database', True) diff --git a/proxywatchd.py b/proxywatchd.py index 48de504..7f65bc5 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -32,7 +32,8 @@ class WorkerJob(): def connect_socket(self): srvname = random.choice(config.servers).strip() protos = ['http', 'socks5', 'socks4'] if self.proto is None else [self.proto] - server_port = 6697 if config.watchd.use_ssl else 6667 + use_ssl = random.choice([0,1]) if config.watchd.use_ssl == 2 else config.watchd.use_ssl + server_port = 6697 if use_ssl else 6667 fail_inc = 1 @@ -70,7 +71,7 @@ class WorkerJob(): ] try: - sock = rocksock.Rocksock(host=srv, port=server_port, ssl=config.watchd.use_ssl, proxies=proxies, timeout=config.watchd.timeout) + sock = rocksock.Rocksock(host=srv, port=server_port, ssl=use_ssl, proxies=proxies, timeout=config.watchd.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, srvname, 0