Skip to content

v2.0.0

Choose a tag to compare

@j0shcap j0shcap released this 26 Feb 05:29
· 37 commits to main since this release

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 returning False due 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_exact helper (previously assumed all bytes arrived in one recv)
  • Fixed server shutdown order (shutdown() before server_close())
  • Fixed raise e losing tracebacks in TCP relay (now bare raise)
  • Fixed duplicate log handlers when update_loggers() is called
  • Fixed proxy_address AttributeError (now initialized to None)
  • Fixed DNS thread leaks (replaced ThreadPoolExecutor with 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() with logger.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_PASSWORD environment 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_LEVEL build arg
  • Added HEALTHCHECK to Dockerfile
  • Added .dockerignore
  • Added pyproject.toml with project metadata
  • Added flake8 linting to CI pipeline
  • Added pytest-cov with 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 ProxyConfiguration tests
  • 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-python action from v3 to v5

Full Changelog: v1.0.0...v2.0.0