Skip to content

v0.3.4

Choose a tag to compare

@Scratch-net Scratch-net released this 08 Apr 16:08
· 88 commits to main since this release

Highlights

Connection Leak Fix

Discovered that gnet's SetReadDeadline is epoll-based and only fires on read attempts. Connections that never send data (probes, scanners, bots) stayed open indefinitely, accumulating until the proxy stopped accepting new connections.

Fixed with an active time.AfterFunc timer that closes any connection still in pre-auth state after the handshake deadline.

Per-IP Limiting Covers All Connections

max-connections-per-ip previously only applied after authentication. Now enforced at TCP accept time — unauthenticated floods from a single IP are blocked before any protocol work begins.

Splice Idle Timeout

Spliced (unrecognized) connections now have a dedicated shorter idle timeout (default 30s) instead of sharing the authenticated connection timeout (5m).

What's Changed

Fixes

  • Silent connections (no data sent) are now actively killed after handshake timeout
  • Per-IP connection limit enforced in OnOpen before authentication
  • Splice path now clears handshake deadline and sets its own idle timeout

New Config Options

  • handshake-timeout — max time for handshake before dropping (default 5s, was hardcoded 30s)
  • splice-idle-timeout — idle timeout for spliced connections (default 30s)

Full Changelog: v0.3.3...v0.3.4