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

reflex

package
v0.0.158 Latest Latest
Warning

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

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

Documentation

Overview

Package reflex implements the Reflex protocol, where TLS roles are reversed relative to TCP roles. The TCP client acts as the TLS server, and the TCP server (proxy) acts as the TLS client. This defeats SNI-based censorship and JA3/JA4 fingerprinting because no ClientHello appears in the client→server direction.

Authentication is embedded in the TLS handshake itself: the client presents a TLS certificate whose SHA-256 fingerprint the server validates against a pre-shared expected value. No pre-handshake bytes are exchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DERFingerprint

func DERFingerprint(der []byte) string

DERFingerprint returns the hex-encoded SHA-256 of DER-encoded certificate bytes.

func RegisterInbound

func RegisterInbound(registry *inbound.Registry)

func RegisterOutbound

func RegisterOutbound(registry *outbound.Registry)

Types

type Inbound

type Inbound struct {
	inbound.Adapter
	// contains filtered or unexported fields
}

Inbound implements the server side of Reflex. It accepts TCP connections, immediately sends a TLS ClientHello (reversed role), then validates the peer's certificate fingerprint as authentication.

func (*Inbound) Close

func (i *Inbound) Close() error

func (*Inbound) NewConnectionEx

func (i *Inbound) NewConnectionEx(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

NewConnectionEx handles a new TCP connection with the reversed TLS handshake.

func (*Inbound) Start

func (i *Inbound) Start(stage adapter.StartStage) error

type Outbound

type Outbound struct {
	outbound.Adapter
	// contains filtered or unexported fields
}

Outbound implements the client side of Reflex. It dials a TCP connection, then acts as a TLS server (waits for ClientHello from the proxy). The server validates the client's TLS certificate fingerprint as authentication.

func (*Outbound) Close

func (o *Outbound) Close() error

func (*Outbound) DialContext

func (o *Outbound) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Outbound) ListenPacket

func (o *Outbound) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Outbound) Network

func (o *Outbound) Network() []string

Jump to

Keyboard shortcuts

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