Commit Graph

108 Commits

Author SHA1 Message Date
Username
07262e8b50 proxywatchd: cap threads by queue size, faster scale-down 2025-12-26 18:12:39 +01:00
Username
560230988d support multiple checktypes with random selection 2025-12-25 20:23:05 +01:00
Username
0424527e84 proxywatchd: add 0.3s delay before SSL fallback to HTTP 2025-12-25 19:49:59 +01:00
Username
3ac7305954 proxywatchd: persist MITM certificate stats across restarts
Add save_state/load_state to MITMCertStats for JSON persistence.
Stats saved periodically (5min) and at shutdown, loaded at startup.
2025-12-25 19:47:51 +01:00
Username
68e8b88afa tor: use random credentials for circuit isolation
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s
2025-12-25 19:18:25 +01:00
Username
9ba965c87f proxywatchd: ensure socket cleanup before SSL fallback
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s
2025-12-25 19:13:47 +01:00
Username
b41d077905 proxywatchd: make peak_rate per-session, not persistent
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s
2025-12-25 18:54:05 +01:00
Username
92b4036c37 proxywatchd: delay peak measurement until after startup
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s
2025-12-25 18:48:27 +01:00
Username
a8d06666b7 proxywatchd: fallback to HTTP when SSL fails
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s
2025-12-25 18:39:51 +01:00
Username
c459736561 proxywatchd: add sanity checks to rate/peak calculations
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s
2025-12-25 18:11:22 +01:00
Username
2201515b10 proxywatchd: track failures by protocol and SSL category 2025-12-25 02:51:47 +01:00
Username
38fb16a439 proxywatchd: fix mitm reset logic, track ssl_mitm category 2025-12-24 01:26:37 +01:00
Username
4f17e7c546 proxywatchd: treat MITM as working, mark fatal errors as dead
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s
2025-12-24 01:17:02 +01:00
Username
de750a1312 proxywatchd: fix division, uptime, and scaler
- Add from __future__ import division for correct percentages
- Remove start_time restoration so uptime reflects current session
- Remove success_rate threshold for scaling (scale on queue depth only)
2025-12-24 00:17:47 +01:00
Username
f83733dd46 proxywatchd: mark confirmed-dead proxies as permanently dead
- Add DEAD_PROXY=-1 constant for permanently dead proxies
- Mark proxy dead when: failed >= max_fail*2, or max_fail with fatal error
- Fatal errors: refused, unreachable, auth (proxy definitely not working)
- Dead proxies excluded from testing (failed >= 0 query)
- Cleanup_stale also removes old dead proxies
- Dashboard shows separate dead vs failing counts
2025-12-23 18:03:01 +01:00
Username
1e2054bec5 dashboard: fix missing tor pool and db stats fields 2025-12-23 17:56:12 +01:00
Username
c0dbba7b45 proxywatchd: gevent concurrency and comprehensive stats
Major features:
- gevent monkey-patching for cooperative concurrency
- Stats class with latency percentiles, histograms, geo tracking
- session state persistence across restarts
- JudgeStats with cooldown for blocked/rate-limited judges
- ThreadScaler for dynamic greenlet pool sizing
- SIGHUP handler for config hot-reload
- SSL/TLS tracking with MITM detection
- anonymity detection (transparent/anonymous/elite)

Bug fixes:
- rwip(): fix string comparison (b[0] == '0' not == 0)
- rwip(): fix strip logic (b[1:] not b[:1])
- use string.ascii_letters for Py2/3 compatibility
2025-12-23 17:23:45 +01:00
Username
95bafcacff proxywatchd: add startup logging, fix geolocation error handling 2025-12-21 23:37:19 +01:00
Username
8718d33276 fix: use canonical schema from dbs.py in proxywatchd 2025-12-21 10:30:31 +01:00
Username
79475c2bff add latency tracking and dynamic thread scaling
- dbs.py: add avg_latency, latency_samples columns with migration
- dbs.py: update_proxy_latency() with exponential moving average
- proxywatchd.py: ThreadScaler class for dynamic thread count
- proxywatchd.py: calculate/record latency for successful proxies
- proxywatchd.py: _spawn_thread(), _remove_thread(), _adjust_threads()
- scaler reports status alongside periodic stats
2025-12-21 00:08:19 +01:00
Username
e24f68500c style: normalize indentation and improve code style
- convert tabs to 4-space indentation
- add docstrings to modules and classes
- remove unused import (copy)
- use explicit object inheritance
- use 'while True' over 'while 1'
- use 'while args' over 'while len(args)'
- use '{}' over 'dict()'
- consistent string formatting
- Python 2/3 compatible Queue import
2025-12-20 23:18:45 +01:00
Username
a694e441a4 proxywatchd: add priority queue for job scheduling 2025-12-20 23:11:49 +01:00
Username
af5e1ce4b0 proxywatchd: integrate tor connection pool 2025-12-20 23:02:26 +01:00
Username
2f2ff9a385 proxywatchd: add stats tracking and httpd integration
- Stats class with failure category tracking
- Configurable stats_interval for periodic reports
- Optional httpd server startup when enabled
- cleanup_stale() for removing dead proxies
2025-12-20 22:28:23 +01:00
Username
86cabd1562 standardize code style: shebangs, class definitions, comments 2025-12-20 18:05:41 +01:00
Username
68d6a8e15f proxywatchd: implement multi-target validation with work-stealing queue 2025-12-20 16:46:09 +01:00
Your Name
d7db366857 split to ip/port, "cleanse" ips and ports, bugfixes 2021-08-22 20:39:50 +02:00
Your Name
c3bb49d229 proxywatchd: make use of verifycert 2021-07-27 22:36:24 +02:00
Your Name
d4dd2a42ea proxywatchd.py: randomly choose from available regex keys 2021-07-05 16:54:17 +02:00
Your Name
d78212ac50 proxywatchd.py: add more websites 2021-07-05 16:45:02 +02:00
Your Name
a0bc4e4502 do not perform ssl_check when successive_success=0
aestetics
2021-07-03 20:11:46 +02:00
Your Name
f6c3347eb4 proxywatchd: match specific regex per server/protocol 2021-07-03 19:59:47 +02:00
Your Name
a005cc109c force ssl check (mitm) every 3 consecutive success check
needs a new entry in proxies.sqlite

sqlite3 proxies.sqlite "alter table proxylist add consecutive_success int"
sqlite3 proxies.sqlite "update proxylist set consecutive_success=0"
2021-07-03 18:47:34 +02:00
Your Name
11c5bd67b3 add http check 2021-07-03 18:47:34 +02:00
Your Name
6b6cd94cec spaces to tabs 2021-06-27 12:31:15 +02:00
Your Name
d3d83e1d90 changes 2021-05-12 08:06:03 +02:00
Your Name
9a7a913401 proxywatchd.py: also accept "ERROR" as success message (heh) 2021-05-02 16:11:57 +02:00
Your Name
cae6f75643 changs 2021-05-02 00:22:12 +02:00
Your Name
298987612c proxywatchd: do not test that much oldies 2021-02-10 22:25:41 +01:00
Your Name
9aa2c91f41 more random changes 2021-02-06 11:00:25 +01:00
Your Name
e15b9d2994 more changes 2021-02-04 23:06:37 +01:00
Your Name
78b29a1187 some changes 2021-01-24 03:52:56 +01:00
Mickaël Serneels
f179080cca use geoloc
now saves proxy's country in db
2019-05-17 22:59:32 +02:00
rofl0r
866f308322 proxywatchd: remove bogus blanket exception handler
this would catch *any* exception, including typos
2019-05-01 20:05:57 +01:00
Mickaël Serneels
d09244d04d proxywatchd: fix Exception error
Exception in thread Thread-9:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "proxywatchd.py", line 200, in workloop
    job.run()
  File "proxywatchd.py", line 123, in run
    sock, proto, duration, tor, srv, failinc = self.connect_socket()
ValueError: need more than 5 values to unpack
2019-05-01 17:43:28 +02:00
Mickaël Serneels
7aea9a3e53 irc: minimize possible response code 2019-05-01 17:43:28 +02:00
Mickaël Serneels
7b9f8b2e00 create socks4_resolve()
moves socks4 resolution out of socket_connect block
2019-05-01 17:43:28 +02:00
Mickaël Serneels
bad4d25bcf make watchd.tor_safeguard a configurable option (default: True) 2019-05-01 17:43:28 +02:00
Mickaël Serneels
67aec84320 fix Exception error
Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "proxywatchd.py", line 191, in workloop
    job.run()
  File "proxywatchd.py", line 114, in run
    sock, proto, duration, tor, srv, failinc = self.connect_socket()
  File "proxywatchd.py", line 76, in connect_socket
    sock.send('%s\n' % random.choice(['NICK', 'USER', 'JOIN', 'MODE', 'PART', 'INVITE', 'KNOCK', 'WHOIS', 'WHO', 'NOTICE', 'PRIVMSG', 'PING', 'QUIT']))
  File "rocksock.py", line 279, in send
    return self.sock.sendall(buf)
  File "/usr/lib/python2.7/ssl.py", line 741, in sendall
    v = self.send(data[count:])
  File "/usr/lib/python2.7/ssl.py", line 707, in send
    v = self._sslobj.write(data)
error: [Errno 32] Broken pipe
2019-05-01 17:43:28 +02:00
mickael
310b01140a irc: implement use_ssl = 2
0: disabled, 1: enabled, 2: maybe
default is 0
2019-05-01 17:43:28 +02:00