Documentation
¶
Overview ¶
Package relay implements the bidirectional TCP proxy that sits between a local VPN client and the upstream (cloaked) server.
The relay is platform-agnostic: once the DPI bypass (packet injection) has succeeded for a flow, the relay simply shuttles bytes in both directions. Zero-copy fast paths (splice on Linux, TransmitFile on Windows) are added in the platform packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Listener ¶
Listener is a thin wrapper that applies relay-friendly TCP socket options. Individual platform backends may replace it with one that also installs packet-filter rules, but the defaults here work anywhere Go runs.
func NewListener ¶
NewListener binds addr and returns a *Listener with TCP keepalive preset.
type Options ¶
type Options struct {
// IdleTimeout aborts a relay if no data moves in either direction for
// this long. Zero means no timeout.
IdleTimeout time.Duration
// OnBytes, if set, is called periodically with (txToRemote, rxFromRemote)
// cumulative byte counts for metrics.
OnBytes func(tx, rx uint64)
}
Options configures relay behaviour.