Help us shape the future of Go! Take the 2026 Go Developer Survey

masquerade

package
v0.0.163 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package masquerade implements the splitting egress: a connection that fails to authenticate is forwarded verbatim to a real cover site, which answers it.

For protocols that cannot complete a genuine handshake with an unauthenticated peer -- reflex, and twiddle, whose TLS opening is synthesised -- this is not an optional hardening. It is the only thing standing between an active prober and a distinguishing reply.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstRealError

func FirstRealError(errs ...error) error

FirstRealError returns the first non-nil, non-EOF, non-closed-network error.

func Forward

func Forward(ctx context.Context, conn net.Conn, upstream string, prefix []byte) error

Blocks until both copy directions return. Returns the first non-EOF copy error, or the dial/replay error, or nil on clean close.

Blocks until both copy directions return. Returns the first non-EOF copy error, or the dial/replay error, or nil on clean close.

To unblock the copy loops on context cancellation and when either direction finishes, this function may close both the upstream connection and conn. Callers should treat conn as possibly-closed after return. Forward transparently forwards conn to upstream (host:port), prepending any prefix bytes already consumed from conn.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL