Repository navigation
v2.0.0
What's Changed
Breaking Changes
- Dropped Python 3.7, 3.8, 3.9 — minimum version is now Python 3.10. Added 3.13 to CI.
Bug Fixes
- Fixed
is_initialized()always returningFalsedue to wrong attribute names - Fixed IPv6 replies crashing with
struct.error(variable-length packing) - Fixed IPv6
getsockname()/getpeername()4-tuple unpacking crash - Fixed UDP relay: added timeouts, error handling, and socket cleanup (previously blocked indefinitely and leaked sockets)
- Fixed thread-unsafe logger cache with
threading.Lock - Fixed selector leak when
TCPRelay.__init__fails - Fixed socket timeout not restored after authentication
- Fixed partial TCP reads with
recv_exacthelper (previously assumed all bytes arrived in onerecv) - Fixed server shutdown order (
shutdown()beforeserver_close()) - Fixed
raise elosing tracebacks in TCP relay (now bareraise) - Fixed duplicate log handlers when
update_loggers()is called - Fixed
proxy_addressAttributeError (now initialized toNone) - Fixed DNS thread leaks (replaced
ThreadPoolExecutorwith daemon threads) - Fixed error replies always using IPv4 address type regardless of client
- Fixed UDP relay crash on domain-name datagrams
- Fixed double-close of client socket between relay and server
- Replaced deprecated
logger.warn()withlogger.warning() - Validated RSV field per RFC 1928
Improvements
- Added connection limit (200 max) to prevent unbounded thread creation
- Added timeout to both forward and reverse DNS lookups
- Credentials now configurable via
SOCKS5_USERNAME/SOCKS5_PASSWORDenvironment variables - Replaced magic numbers with named constants throughout
- Unified reply-sending pattern in server command handling
- Replaced wildcard imports with explicit imports and
__all__ - Consolidated two Dockerfiles into one with
LOGGING_LEVELbuild arg - Added
HEALTHCHECKto Dockerfile - Added
.dockerignore - Added
pyproject.tomlwith project metadata - Added flake8 linting to CI pipeline
- Added
pytest-covwith 60% coverage threshold to CI
Tests
- 112 tests, 71% code coverage (up from ~30%)
- Added TCP relay tests (selector, cleanup, data forwarding)
- Added UDP relay tests (forwarding, fragmentation, error handling)
- Added logger thread safety tests
- Added
ProxyConfigurationtests - Added DNS timeout tests for both forward and reverse lookups
- Implemented all TODO test stubs (parse_request, address parsing, RSV validation)
- Fixed duplicate IPv6 tests, incorrect mock data, and socket leaks in tests
Documentation
- Rewrote README with CI badges, quick start, Docker usage, auth docs, and testing instructions
- Updated
setup-pythonaction from v3 to v5
Full Changelog: v1.0.0...v2.0.0