Versions in this module Expand all Collapse all v1 v1.9.1 May 4, 2026 v1.9.0 Apr 26, 2026 v1.8.0 Apr 10, 2026 v1.7.0 Apr 9, 2026 Changes in this version + const DefaultHandshakeTimeout type ProxyOpts + HandshakeTimeout time.Duration v1.6.0 Apr 1, 2026 Changes in this version + type EventThrottled struct + SecretName string + func NewEventThrottled(streamID, secretName string) EventThrottled + func (e EventThrottled) StreamID() string + func (e EventThrottled) Timestamp() time.Time type ProxyOpts + ThrottleCheckInterval time.Duration + ThrottleMaxConnections uint type ProxyStats + func (s *ProxyStats) CanConnect(name string) bool + func (s *ProxyStats) SetThrottle(limit int64, interval time.Duration) type StatsResponse + Throttle *ThrottleJSON + type ThrottleJSON struct + Active bool + Caps map[string]int64 + Limit int64 v1.5.0 Apr 1, 2026 Changes in this version + const ConnectionIDBytesLength + const DefaultBufferSize + const DefaultConcurrency + const DefaultDomainFrontingPort + const DefaultIdleTimeout + const DefaultPreferIP + const DefaultTolerateTimeSkewness + const DoppelGangerEach + const DoppelGangerPerRaid + const SecretKeyLength + const TCPRelayReadTimeout + var ErrAntiReplayCacheIsNotDefined = errors.New("anti-replay cache is not defined") + var ErrEventStreamIsNotDefined = errors.New("event stream is not defined") + var ErrIPAllowlistIsNotDefined = errors.New("ip allowlist is not defined") + var ErrIPBlocklistIsNotDefined = errors.New("ip blocklist is not defined") + var ErrLoggerIsNotDefined = errors.New("logger is not defined") + var ErrNetworkIsNotDefined = errors.New("network is not defined") + var ErrSecretEmpty = errors.New("secret is empty") + var ErrSecretInvalid = errors.New("secret is invalid") + type AntiReplayCache interface + SeenBefore func(data []byte) bool + type Event interface + StreamID func() string + Timestamp func() time.Time + type EventConcurrencyLimited struct + func NewEventConcurrencyLimited() EventConcurrencyLimited + func (e EventConcurrencyLimited) StreamID() string + func (e EventConcurrencyLimited) Timestamp() time.Time + type EventConnectedToDC struct + DC int + RemoteIP net.IP + func NewEventConnectedToDC(streamID string, remoteIP net.IP, dc int) EventConnectedToDC + func (e EventConnectedToDC) StreamID() string + func (e EventConnectedToDC) Timestamp() time.Time + type EventDomainFronting struct + func NewEventDomainFronting(streamID string) EventDomainFronting + func (e EventDomainFronting) StreamID() string + func (e EventDomainFronting) Timestamp() time.Time + type EventFinish struct + func NewEventFinish(streamID string) EventFinish + func (e EventFinish) StreamID() string + func (e EventFinish) Timestamp() time.Time + type EventIPBlocklisted struct + IsBlockList bool + RemoteIP net.IP + func NewEventIPAllowlisted(remoteIP net.IP) EventIPBlocklisted + func NewEventIPBlocklisted(remoteIP net.IP) EventIPBlocklisted + func (e EventIPBlocklisted) StreamID() string + func (e EventIPBlocklisted) Timestamp() time.Time + type EventIPListSize struct + IsBlockList bool + Size int + func NewEventIPListSize(size int, isBlockList bool) EventIPListSize + func (e EventIPListSize) StreamID() string + func (e EventIPListSize) Timestamp() time.Time + type EventReplayAttack struct + func NewEventReplayAttack(streamID string) EventReplayAttack + func (e EventReplayAttack) StreamID() string + func (e EventReplayAttack) Timestamp() time.Time + type EventStart struct + RemoteIP net.IP + func NewEventStart(streamID string, remoteIP net.IP) EventStart + func (e EventStart) StreamID() string + func (e EventStart) Timestamp() time.Time + type EventStream interface + Send func(context.Context, Event) + type EventTraffic struct + IsRead bool + Traffic uint + func NewEventTraffic(streamID string, traffic uint, isRead bool) EventTraffic + func (e EventTraffic) StreamID() string + func (e EventTraffic) Timestamp() time.Time + type IPBlocklist interface + Contains func(net.IP) bool + Run func(time.Duration) + Shutdown func() + type Logger interface + BindInt func(name string, value int) Logger + BindJSON func(name, value string) Logger + BindStr func(name, value string) Logger + Debug func(msg string) + DebugError func(msg string, err error) + Info func(msg string) + InfoError func(msg string, err error) + Named func(name string) Logger + Printf func(format string, args ...any) + Warning func(msg string) + WarningError func(msg string, err error) + type Network interface + Dial func(network, address string) (essentials.Conn, error) + DialContext func(ctx context.Context, network, address string) (essentials.Conn, error) + MakeHTTPClient func(func(ctx context.Context, network, address string) (essentials.Conn, error)) *http.Client + NativeDialer func() *net.Dialer + type Proxy struct + func NewProxy(opts ProxyOpts) (*Proxy, error) + func (p *Proxy) DomainFrontingAddress() string + func (p *Proxy) Serve(listener net.Listener) error + func (p *Proxy) ServeConn(conn essentials.Conn) + func (p *Proxy) Shutdown() + type ProxyOpts struct + APIBindTo string + AllowFallbackOnUnknownDC bool + AntiReplayCache AntiReplayCache + AutoUpdate bool + BufferSize uint + Concurrency uint + DCOverrides map[int][]string + DomainFrontingIP string + DomainFrontingPort uint + DomainFrontingProxyProtocol bool + DoppelGangerDRS bool + DoppelGangerEach time.Duration + DoppelGangerPerRaid uint + DoppelGangerURLs []string + EventStream EventStream + IPAllowlist IPBlocklist + IPBlocklist IPBlocklist + IdleTimeout time.Duration + Logger Logger + Network Network + PreferIP string + Secret Secret + Secrets map[string]Secret + TolerateTimeSkewness time.Duration + UseTestDCs bool + type ProxyStats struct + func NewProxyStats() *ProxyStats + func (s *ProxyStats) AddBytesIn(name string, n int64) + func (s *ProxyStats) AddBytesOut(name string, n int64) + func (s *ProxyStats) OnConnect(name string) + func (s *ProxyStats) OnDisconnect(name string) + func (s *ProxyStats) PreRegister(name string) + func (s *ProxyStats) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *ProxyStats) StartServer(ctx context.Context, bindTo string, logger Logger) + func (s *ProxyStats) UpdateLastSeen(name string) + type Secret struct + Host string + Key [SecretKeyLength]byte + func GenerateSecret(hostname string) Secret + func ParseSecret(secret string) (Secret, error) + func (s *Secret) Set(text string) error + func (s *Secret) UnmarshalText(data []byte) error + func (s Secret) Base64() string + func (s Secret) Hex() string + func (s Secret) MarshalText() ([]byte, error) + func (s Secret) String() string + func (s Secret) Valid() bool + type StatsResponse struct + StartedAt time.Time + TotalConnections int64 + UptimeSeconds int64 + Users map[string]UserStatsJSON + type UserStatsJSON struct + BytesIn int64 + BytesOut int64 + Connections int64 + LastSeen *time.Time