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

option

package
v0.0.162 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ALGenevaInboundOptions

type ALGenevaInboundOptions struct {
	option.HTTPMixedInboundOptions
}

type ALGenevaOutboundOptions

type ALGenevaOutboundOptions struct {
	option.HTTPOutboundOptions
	Strategy string `json:"strategy,omitempty"`
}

type AmneziaEndpointOptions

type AmneziaEndpointOptions struct {
	O.WireGuardEndpointOptions
	AmneziaOptions
}

type AmneziaOptions

type AmneziaOptions struct {
	JunkPacketCount            int    `json:"junk_packet_count,omitempty"`             // jc
	JunkPacketMinSize          int    `json:"junk_packet_min_size,omitempty"`          // jmin
	JunkPacketMaxSize          int    `json:"junk_packet_max_size,omitempty"`          // jmax
	InitPacketJunkSize         int    `json:"init_packet_junk_size,omitempty"`         // s1
	ResponsePacketJunkSize     int    `json:"response_packet_junk_size,omitempty"`     // s2
	InitPacketMagicHeader      uint32 `json:"init_packet_magic_header,omitempty"`      // h1
	ResponsePacketMagicHeader  uint32 `json:"response_packet_magic_header,omitempty"`  // h2
	UnderloadPacketMagicHeader uint32 `json:"underload_packet_magic_header,omitempty"` // h3
	TransportPacketMagicHeader uint32 `json:"transport_packet_magic_header,omitempty"` // h4
}

type BanditProbeOutboundOptions

type BanditProbeOutboundOptions struct {
	// CallbackURL is where the proxy sends the callback once it has a verdict,
	// e.g. "https://api.iantem.io/v1/bandit/callback". It must be https: the
	// callback carries the probe token and device ID across the open internet.
	CallbackURL string `json:"callback_url"`

	// BodySize is the number of random bytes sent back to the client. It has to
	// exceed the point at which censors freeze a flow (default: 65536).
	BodySize int `json:"body_size,omitempty"`

	// StallTimeout is how long acknowledgements may stop advancing, with data
	// still unacknowledged, before the probe is judged stalled (default: 2.5s).
	StallTimeout badoption.Duration `json:"stall_timeout,omitempty"`

	// MaxWait bounds the verdict (default: 10s, at most 15s). The callback has to
	// reach the API before its reaper expires the probe, so this must leave room
	// for the callback inside that window.
	MaxWait badoption.Duration `json:"max_wait,omitempty"`

	// ReportStalled sends the callback with verdict=stalled instead of dropping
	// it. Enable it only when the API treats verdict=stalled as a failure;
	// otherwise a stalled probe is counted as a success, whereas a dropped
	// callback is counted as a failure.
	ReportStalled bool `json:"report_stalled,omitempty"`
}

BanditProbeOutboundOptions configures the server-side responder for bandit callback probes. Route a client's plain-HTTP callback request to this outbound and the proxy answers it itself, judges delivery from its own TCP state, and forwards the callback to the API. Zero values fall back to the defaults noted on each field.

type DNSEntryConfig

type DNSEntryConfig struct {
	// System is used for using the system as a resolver, if you want to use it
	// provide an empty object.
	System *struct{} `json:"system,omitempty"`
	// HTTPS use an encrypted DNS over HTTPS (DoH) resolver.
	HTTPS *HTTPSEntryConfig `json:"https,omitempty"`
	// TLS use an encrypted DNS over TLS (DoT) resolver.
	TLS *TLSEntryConfig `json:"tls,omitempty"`
	// UDP use a UDP resolver
	UDP *UDPEntryConfig `json:"udp,omitempty"`
	// TCP use a TCP resolver
	TCP *TCPEntryConfig `json:"tcp,omitempty"`
}

DNSEntryConfig specifies a list of resolvers to test and they can be one of the attributes (system, https, tls, udp or tcp)

type FallbackOutboundOptions

type FallbackOutboundOptions struct {
	// Primary and Fallback are the tags of the primary and fallback outbounds.
	Primary  string `json:"primary"`
	Fallback string `json:"fallback"`
}

type FrontSpec

type FrontSpec struct {
	IPAddress      string `json:"ip_address"`
	SNI            string `json:"sni,omitempty"`
	VerifyHostname string `json:"verify_hostname,omitempty"`
}

FrontSpec is one (CDN edge IP, outer SNI) pair to dial. Empty SNI means send no ServerName extension (Akamai-style); non-empty SNI is sent in the ClientHello (CloudFront-style). VerifyHostname is the host expected on the cert chain.

type HTTPSEntryConfig

type HTTPSEntryConfig struct {
	// Domain name of the host.
	Name string `json:"name,omitempty"`
	// Host:port. Defaults to Name:443.
	Address string `json:"address,omitempty"`
}

type Hysteria2XOutboundOptions

type Hysteria2XOutboundOptions struct {
	O.Hysteria2OutboundOptions
	// PreInitialJunk sends one short random UDP datagram to the server on each
	// new UDP flow before the QUIC Initial. The GFW assumes the first datagram of
	// a flow is the Initial; when it can't parse it, it stops inspecting the flow,
	// so the real Initial (and its SNI) goes through uninspected. QUIC servers
	// drop the junk. See GFW Report, "Exposing and Circumventing SNI-based QUIC
	// Censorship of the Great Firewall of China" (USENIX Security 2025), §7.
	PreInitialJunk bool `json:"pre_initial_junk,omitempty"`
}

Hysteria2XOutboundOptions are the stock sing-box hysteria2 outbound options plus Lantern's QUIC-censorship evasions. The server side is a stock hysteria2 inbound; every evasion here is client-only.

type MeekHeaders

type MeekHeaders map[string]string

MeekHeaders carries fixed-value HTTP headers added to every POST.

type MeekInboundOptions

type MeekInboundOptions struct {
	option.ListenOptions

	// MaxBodyBytes caps the request + response body per poll. Default 256 KiB
	// (must match the client's cap, or bodies truncate).
	MaxBodyBytes int `json:"max_body_bytes,omitempty"`
	// ResponseHoldoff is how long the server waits for upstream bytes before
	// responding (possibly empty). Default "50ms".
	ResponseHoldoff string `json:"response_holdoff,omitempty"`
	// SessionIdleTimeout drops a session after this long without a poll; should
	// be >= 2-3x the client's poll interval. Default "5m".
	SessionIdleTimeout string `json:"session_idle_timeout,omitempty"`
	// AuthToken is the shared secret every request must present in X-Meek-Auth.
	// Required by default — a meek inbound is a public/fronted relay into sing-box,
	// so an empty token is an open relay. To deliberately run without auth (test or
	// private deployments), set AllowUnauthenticated.
	AuthToken string `json:"auth_token,omitempty"`
	// AllowUnauthenticated explicitly opts into the no-auth mode (empty AuthToken).
	// Off by default so the secure path is the default.
	AllowUnauthenticated bool `json:"allow_unauthenticated,omitempty"`

	// HTTP server timeouts (empty -> defaults). ReadTimeout/WriteTimeout bound a
	// single poll; IdleTimeout bounds keep-alive reuse between polls.
	ReadTimeout  string `json:"read_timeout,omitempty"`
	WriteTimeout string `json:"write_timeout,omitempty"`
	IdleTimeout  string `json:"idle_timeout,omitempty"`
}

MeekInboundOptions configures a meek server inbound: an HTTP meek-v1 endpoint (plain HTTP — TLS and CDN fronting are terminated by Caddy/a CDN in front) whose tunneled sessions are routed through sing-box. Each session opens with a SOCKS5 CONNECT (as the bundled meek outbound sends), which the inbound terminates in-process and hands to the router — so no external SOCKS5 proxy (microsocks) is required, unlike the standalone cmd/meek-server.

type MeekOutboundOptions

type MeekOutboundOptions struct {
	option.DialerOptions

	URL    string      `json:"url"`              // meek server URL (e.g. https://meek.dsa.akamai.getiantem.org/)
	Fronts []FrontSpec `json:"fronts"`           // candidate fronts
	Header MeekHeaders `json:"header,omitempty"` // extra HTTP headers per request

	PollIntervalMs int    `json:"poll_interval_ms,omitempty"` // default 100
	MaxBodyBytes   int    `json:"max_body_bytes,omitempty"`   // default 256 KiB (caps request + response bodies per poll)
	SessionIDLen   int    `json:"session_id_len,omitempty"`   // default 16
	ConnectTimeout string `json:"connect_timeout,omitempty"`  // default "15s"
	ReadTimeout    string `json:"read_timeout,omitempty"`     // default "30s"
}

MeekOutboundOptions configures a domain-fronted meek outbound that tunnels arbitrary TCP through HTTPS POSTs to a meek server endpoint.

Fronts is the candidate front pool — pairs of (CDN edge IP, outer SNI) known to route the inner Host (URL.Host) to the meek server. Radiance populates this from the fronted/scanner package's discoveries; without at least one front the outbound has nothing to dial.

type MutableAutoSelectOutboundOptions

type MutableAutoSelectOutboundOptions struct {
	Outbounds    []string          `json:"outbounds"`
	URL          string            `json:"url,omitempty"`
	URLOverrides map[string]string `json:"url_overrides,omitempty"`

	// SwitchToleranceMs is the delay improvement (in ms) a candidate must
	// beat the current selection by before the group switches. Default 200.
	SwitchToleranceMs uint32 `json:"switch_tolerance_ms,omitempty"`

	// ConsecutiveFailureLimit hard-demotes a member once probe failures
	// reach this count, or once user-traffic failures within
	// UserFailureWindowSeconds reach this count. Default 3.
	ConsecutiveFailureLimit uint32 `json:"consecutive_failure_limit,omitempty"`

	// SoftDemoteLimit soft-demotes a member once user-traffic failures
	// within UserFailureWindowSeconds reach this count. Among eligible
	// members, soft-demoted peers rank below clean peers and above
	// hard-demoted peers. Set lower for a fleet with few alternatives;
	// higher for a large pool where one transient stall shouldn't be
	// enough to push the active member behind every clean alternative.
	// Default 2.
	SoftDemoteLimit uint32 `json:"soft_demote_limit,omitempty"`

	// UserFailureWindowSeconds is the sliding-window length used to
	// count user-traffic failures (dial errors, resets, unanswered
	// writes, and stalls) for the demote rule. Failures older than
	// this age out of the window so a transient failure self-recovers
	// without depending on traffic being routed through the member.
	// Default 300 (5 min).
	UserFailureWindowSeconds uint32 `json:"user_failure_window_seconds,omitempty"`

	// MaxPersistedAgeSeconds caps the age of persisted TagHistory
	// entries on hydrate. Entries with UpdatedAt older than this are
	// dropped — bandit-driven candidate sets typically rotate every
	// 60 s – 15 min, so a stale snapshot from a prior session would
	// describe a member that may no longer exist. Default 3600 (1 h).
	MaxPersistedAgeSeconds uint32 `json:"max_persisted_age_seconds,omitempty"`

	// BackgroundIntervalSeconds is the active cadence for the low-priority
	// probe cycle (when data has flowed recently — see
	// IdleThresholdSeconds). Default 180.
	BackgroundIntervalSeconds uint32 `json:"background_interval_seconds,omitempty"`

	// IdleIntervalSeconds is the cadence used when no data has flowed
	// through a wrapped data-plane conn for IdleThresholdSeconds.
	// Default 900 (15 min).
	IdleIntervalSeconds uint32 `json:"idle_interval_seconds,omitempty"`

	// IdleThresholdSeconds is the no-data-plane-activity window after
	// which the background probe cadence backs off from
	// BackgroundIntervalSeconds to IdleIntervalSeconds. Default 600
	// (10 min).
	IdleThresholdSeconds uint32 `json:"idle_threshold_seconds,omitempty"`

	// LadderTotalBudgetSeconds is the total budget the reconnection ladder
	// has before emitting the exhaustion signal. Default 10.
	LadderTotalBudgetSeconds uint32 `json:"ladder_total_budget_seconds,omitempty"`

	// LadderCooldownSeconds is the minimum time after a ladder run before
	// another ladder run can fire. Suppresses repeated full-fleet
	// re-probes when stalls or dial errors arrive in quick succession on
	// the same already-shuffled pool. Default 60.
	LadderCooldownSeconds uint32 `json:"ladder_cooldown_seconds,omitempty"`

	// DataPlaneIdleSeconds is the no-traffic threshold after which an
	// established and proven tunnel is treated as a data-plane stall.
	// Default 60.
	DataPlaneIdleSeconds uint32 `json:"data_plane_idle_seconds,omitempty"`

	// DataPlaneProvedReadBytes is the cumulative Read-bytes threshold a
	// single wrapped conn must cross before the data-plane stall timer
	// is allowed to fire. Default 4096.
	DataPlaneProvedReadBytes uint32 `json:"data_plane_proved_read_bytes,omitempty"`

	// DemoteOnlySelectedTag restricts data-plane stall, reset, and no-response
	// attribution to the tag currently selected for TCP or UDP. Default
	// true; set false to count failures from every wrapped conn.
	DemoteOnlySelectedTag *bool `json:"demote_only_selected_tag,omitempty"`

	// ProbeConcurrency caps parallel member probes per batch. Default 6.
	ProbeConcurrency uint32 `json:"probe_concurrency,omitempty"`
}

MutableAutoSelectOutboundOptions configures the MutableAutoSelect group. Zero values fall back to documented defaults.

type MutableSelectorOutboundOptions

type MutableSelectorOutboundOptions struct {
	Outbounds []string `json:"outbounds"`
}

type MutableURLTestOutboundOptions

type MutableURLTestOutboundOptions struct {
	Outbounds    []string           `json:"outbounds"`
	URL          string             `json:"url,omitempty"`
	URLOverrides map[string]string  `json:"url_overrides,omitempty"`
	Interval     badoption.Duration `json:"interval,omitempty"`
	Tolerance    uint16             `json:"tolerance,omitempty"`
	IdleTimeout  badoption.Duration `json:"idle_timeout,omitempty"`
}

type OutboundOutlineOptions

type OutboundOutlineOptions struct {
	O.DialerOptions
	O.ServerOptions
	DNSResolvers []DNSEntryConfig `json:"dns,omitempty" yaml:"dns,omitempty"`
	TLS          []string         `json:"tls,omitempty" yaml:"tls,omitempty"`
	TestTimeout  string           `json:"test_timeout" yaml:"-"`
	Domains      []string         `json:"domains" yaml:"-"`
}

OutboundOutlineOptions set the outbound options used by the outline-sdk smart dialer. You can find more details about the parameters by looking through the implementation: https://github.com/Jigsaw-Code/outline-sdk/blob/v0.0.18/x/smart/stream_dialer.go#L65-L100 Or check the documentation README: https://github.com/Jigsaw-Code/outline-sdk/tree/v0.0.18/x/smart

type ReflexInboundOptions

type ReflexInboundOptions struct {
	option.ListenOptions

	// AuthTokens contains the SHA-256 fingerprints (lowercase hex-encoded) of
	// allowed peer certificates. In Reflex, the TCP client acts as TLS server
	// and presents a certificate; the TCP server validates its fingerprint.
	// Only connections with a matching fingerprint are accepted.
	AuthTokens []string `json:"auth_tokens"`

	// ServerName is the SNI sent in the TLS ClientHello.
	// Since the server sends the ClientHello, this is invisible to the censor.
	ServerName string `json:"server_name,omitempty"`

	// SilenceTimeout is the duration the server waits for client silence before
	// sending ClientHello. Legitimate Lantern clients send no application data
	// until the server speaks (that's the entire Reflex protocol). Active
	// probes and misdirected TLS clients speak immediately.
	//
	// If the client sends any bytes before this timeout elapses, the connection
	// is transparently forwarded to MasqueradeUpstream instead of receiving a
	// ClientHello. Probes never see Reflex.
	//
	// Set to "0" or leave empty to disable (probing exposure for Reflex).
	// Typical value: "2s". Jittered by SilenceJitter to avoid timing fingerprint.
	SilenceTimeout string `json:"silence_timeout,omitempty"`

	// SilenceJitter is the half-width of a symmetric random offset applied to
	// SilenceTimeout per connection. The actual wait is uniformly distributed
	// in [SilenceTimeout - SilenceJitter, SilenceTimeout + SilenceJitter), so
	// SilenceJitter must be strictly less than SilenceTimeout (otherwise the
	// minimum wait could reach zero and the silence window would be skipped).
	// Defaults to "600ms" when SilenceTimeout is set.
	SilenceJitter string `json:"silence_jitter,omitempty"`

	// MasqueradeUpstream is the host:port of a real TLS service to which
	// connections that fail the silence test are forwarded. Required when
	// SilenceTimeout is set. Example: "www.example.com:443".
	MasqueradeUpstream string `json:"masquerade_upstream,omitempty"`
}

ReflexInboundOptions configures a Reflex inbound proxy. The TCP server acts as the TLS client — it sends ClientHello immediately upon accepting a connection, then validates the peer's certificate.

type ReflexOutboundOptions

type ReflexOutboundOptions struct {
	option.DialerOptions
	option.ServerOptions

	// TLS certificate for the client's TLS server role.
	// The SHA-256 fingerprint of this cert serves as authentication —
	// the server validates it during the TLS handshake.
	CertPEM  string `json:"cert_pem,omitempty"`
	KeyPEM   string `json:"key_pem,omitempty"`
	CertPath string `json:"cert_path,omitempty"`
	KeyPath  string `json:"key_path,omitempty"`

	// ConnectTimeout for the TCP + reversed TLS handshake (default: "15s").
	ConnectTimeout string `json:"connect_timeout,omitempty"`
}

ReflexOutboundOptions configures a Reflex outbound proxy. In Reflex, the TCP client acts as the TLS server — the proxy server initiates the TLS handshake (sends ClientHello). This defeats SNI extraction and JA3/JA4 fingerprinting by the censor, since no ClientHello ever appears in the client→server direction.

Authentication: the server validates the client's TLS certificate fingerprint (SHA-256 of the DER-encoded certificate). No pre-handshake bytes are exchanged — the entire auth is within standard TLS.

type SamizdatInboundOptions

type SamizdatInboundOptions struct {
	option.ListenOptions

	// Authentication
	PrivateKey string   `json:"private_key"` // server X25519 private key (hex, 64 chars)
	ShortIDs   []string `json:"short_ids"`   // allowed client short IDs (hex, 16 chars each)

	// TLS certificate
	CertPath string `json:"cert_path,omitempty"` // path to TLS certificate PEM file
	KeyPath  string `json:"key_path,omitempty"`  // path to TLS key PEM file
	CertPEM  string `json:"cert_pem,omitempty"`  // inline TLS certificate PEM
	KeyPEM   string `json:"key_pem,omitempty"`   // inline TLS key PEM

	// Masquerade
	MasqueradeDomain      string `json:"masquerade_domain,omitempty"`       // domain to masquerade as
	MasqueradeAddr        string `json:"masquerade_addr,omitempty"`         // IP:port override
	MasqueradeIdleTimeout string `json:"masquerade_idle_timeout,omitempty"` // default: "5m"
	MasqueradeMaxDuration string `json:"masquerade_max_duration,omitempty"` // default: "10m"

	// Limits
	MaxConcurrentStreams int `json:"max_concurrent_streams,omitempty"` // per connection (default: 250)
}

SamizdatInboundOptions configures a Samizdat inbound proxy.

type SamizdatOutboundOptions

type SamizdatOutboundOptions struct {
	option.DialerOptions
	option.ServerOptions

	// Authentication
	PublicKey string `json:"public_key"` // server X25519 public key (hex, 64 chars)
	ShortID   string `json:"short_id"`   // pre-shared 8-byte identifier (hex, 16 chars)

	// TLS fingerprint
	ServerName  string `json:"server_name,omitempty"` // cover site SNI (e.g. "ok.ru")
	Fingerprint string `json:"fingerprint,omitempty"` // "chrome" (default), "firefox", "safari"

	// Traffic shaping (enabled by default; set to true to disable)
	DisableJitter bool `json:"disable_jitter,omitempty"` // disable timing jitter
	MaxJitterMs   int  `json:"max_jitter_ms,omitempty"`  // max jitter in ms (default: 30)

	// TCP fragmentation (Geneva-inspired; enabled by default; set to true to disable)
	DisableTCPFragmentation    bool `json:"disable_tcp_fragmentation,omitempty"`    // disable ClientHello fragmentation
	DisableRecordFragmentation bool `json:"disable_record_fragmentation,omitempty"` // disable TLS record fragmentation

	// Connection management
	MaxStreamsPerConn int    `json:"max_streams_per_conn,omitempty"` // max H2 streams per TCP conn (default: 100)
	IdleTimeout       string `json:"idle_timeout,omitempty"`         // close idle connections after (default: "5m")
	ConnectTimeout    string `json:"connect_timeout,omitempty"`      // TCP+TLS connect timeout (default: "15s")

}

SamizdatOutboundOptions configures a Samizdat outbound proxy.

type TCPEntryConfig

type TCPEntryConfig struct {
	// Host:port.
	Address string `json:"address,omitempty"`
}

type TLSEntryConfig

type TLSEntryConfig struct {
	// Domain name of the host.
	Name string `json:"name,omitempty"`
	// Host:port. Defaults to Name:853.
	Address string `json:"address,omitempty"`
}

type TwiddleInboundOptions

type TwiddleInboundOptions struct {
	option.ListenOptions

	// TicketKey is the server's long-term ticket-encryption key, 32 bytes
	// hex-encoded. Clients never hold it; they hold only tickets it issued.
	TicketKey string `json:"ticket_key"`

	// MasqueradeUpstream is the real cover site unauthenticated connections are
	// forwarded to, as host:port. Without it, an active prober gets a
	// distinguishing reply and the transport is trivially confirmed.
	MasqueradeUpstream string `json:"masquerade_upstream"`

	// TicketMaxAge bounds how long an issued ticket stays valid, as a Go
	// duration. Empty uses twiddle's default (24h). The check is never skipped.
	TicketMaxAge string `json:"ticket_max_age,omitempty"`

	// CoverHost is the impersonated identity. Cipher, binder length, ticket
	// length, ServerHello extension order and opening-flight sizes all come
	// from the tuned or default CoverProfile for this DNS hostname. Empty means the host of
	// MasqueradeUpstream. When MasqueradeUpstream uses a DNS name, the two must
	// match; an explicit cover is reserved for upstream IP addresses.
	CoverHost string `json:"cover_host,omitempty"`
}

TwiddleInboundOptions configures the twiddle egress.

twiddle answers a harvested Chrome ClientHello with a synthesised ServerHello and then carries an AEAD tunnel framed as TLS application_data. It cannot complete a genuine TLS handshake, so MasqueradeUpstream is load-bearing rather than optional: every connection that fails to authenticate is forwarded there verbatim, and that forwarding is the whole of its probe resistance.

type TwiddleOutboundOptions

type TwiddleOutboundOptions struct {
	option.DialerOptions
	option.ServerOptions

	// Ticket is the provisioned ticket, base64. Replaced automatically by the
	// one the egress issues in each connection's flight.
	Ticket string `json:"ticket"`

	// FullTicket is the full-handshake companion to Ticket, base64, minted over
	// the same client and psk at the same instant.
	//
	// Without it this client is RESUMPTION-ONLY: every opening it emits carries
	// pre_shared_key, and only about 4% of real browsing connections do, so it
	// sits permanently in a rare bucket. See the twiddle module's
	// docs/full-handshake-carrier.md.
	//
	// Optional, and absence degrades rather than fails, because provisioning
	// gained this field after clients were already deployed with ticket and psk
	// alone.
	FullTicket string `json:"full_ticket,omitempty"`

	// PSK is the pre-shared key paired with Ticket, 32 bytes hex-encoded. The
	// same psk backs FullTicket.
	PSK string `json:"psk"`

	// CoverSNI is the DNS hostname this egress masquerades as (see
	// twiddle.CoverFor). It must agree with the egress's
	// masquerade_upstream.
	CoverSNI string `json:"cover_sni"`

	// HelloPool carries a pool of harvested ClientHellos inline: one hex-encoded
	// record per line. This is the config-delivered tier -- it beats the pool
	// compiled into the twiddle module, which is a snapshot of one Chrome version
	// and ages into a positive signal, but it loses to HelloPoolDevicePath.
	HelloPool string `json:"hello_pool,omitempty"`

	// HelloPoolPath is a config-written pool file, in the same form as
	// HelloPool. It ranks in the same tier and takes precedence within it, so a
	// config fetcher may deliver hellos either way.
	HelloPoolPath string `json:"hello_pool_path,omitempty"`

	// HelloPoolDevicePath is a pool tapped from this device's OWN outbound TLS
	// traffic, and it outranks both of the above.
	//
	// It is the only source that cannot go stale: by construction it holds what
	// the browser installed on this device emits right now, with this device's
	// Chrome version and field-trial state. Every other source is somebody
	// else's snapshot -- the twiddle module's built-in pool already reproduces no
	// Chrome that exists, having been captured before Chrome dropped
	// server_padding (0x12e0) and added 0xca34.
	//
	// Whatever writes this file MUST pass each hello through twiddle.Sanitize
	// first. A tapped hello names a site the user actually visited, and a
	// resumption hello also carries that site's session ticket.
	HelloPoolDevicePath string `json:"hello_pool_device_path,omitempty"`

	// DisableFullHandshake turns off the full-handshake opening even when
	// everything needed for it is present.
	//
	// It exists as a kill switch that costs no release. The opening shape is
	// the most censor-visible thing this transport does, and if a full-handshake
	// opening ever turns out to be the more detectable of the two in some
	// region, the reaction should be a config push rather than a rebuild --
	// the same reasoning that keeps the hello pool as data.
	DisableFullHandshake bool `json:"disable_full_handshake,omitempty"`

	ConnectTimeout string `json:"connect_timeout,omitempty"`
}

TwiddleOutboundOptions configures the twiddle client.

type UDPEntryConfig

type UDPEntryConfig struct {
	// Host:port.
	Address string `json:"address,omitempty"`
}

type UnboundedOutboundOptions

type UnboundedOutboundOptions struct {
	option.DialerOptions
	option.ServerOptions

	// TLS verification. The consumer-side outbound acts as the QUIC *server*
	// so the peer presents a client certificate during the handshake. When
	// InsecureDoNotVerifyClientCert is true, we accept any peer cert — useful
	// in dev. In production set EgressCA (a PEM bundle) and EgressServerName
	// (expected DNS SAN / IP SAN) to authenticate the egress peer.
	InsecureDoNotVerifyClientCert bool   `json:"insecure_do_not_verify_client_cert,omitempty"`
	EgressCA                      string `json:"egress_ca,omitempty"`
	EgressServerName              string `json:"egress_server_name,omitempty"`

	// Broflake tunable parameters. Zero means "use broflake default".
	CTableSize  int    `json:"c_table_size,omitempty"`
	PTableSize  int    `json:"p_table_size,omitempty"`
	BusBufferSz int    `json:"bus_buffer_sz,omitempty"`
	Netstated   string `json:"netstated,omitempty"`

	// WebRTC / signaling parameters.
	DiscoverySrv      string `json:"discovery_srv,omitempty"`
	DiscoveryEndpoint string `json:"discovery_endpoint,omitempty"`
	// InsecureDoNotVerifyDiscoveryCert skips TLS verification of the
	// signaling server's (freddie's) cert. Only for test/dev against
	// self-signed rigs; production freddie deployments present a real cert
	// and this flag must be false. Ignored when a direct transport is
	// injected on the context (radiance's production path), which carries
	// its own verification policy.
	InsecureDoNotVerifyDiscoveryCert bool   `json:"insecure_do_not_verify_discovery_cert,omitempty"`
	GenesisAddr                      string `json:"genesis_addr,omitempty"`
	NATFailTimeout                   int    `json:"nat_fail_timeout,omitempty"` // seconds
	STUNBatchSize                    int    `json:"stun_batch_size,omitempty"`
	// STUNServers is the full pool. At batch time the outbound samples
	// STUNBatchSize entries at random to avoid a static fingerprint.
	STUNServers       []string `json:"stun_servers,omitempty"`
	Tag               string   `json:"tag,omitempty"`
	Patience          int      `json:"patience,omitempty"`      // seconds
	ErrorBackoff      int      `json:"error_backoff,omitempty"` // seconds
	ConsumerSessionID string   `json:"consumer_session_id,omitempty"`

	// Egress server parameters. Consumer-side desktop peers don't usually
	// reach the egress directly, but we plumb these through for extensibility.
	EgressAddr           string `json:"egress_addr,omitempty"`
	EgressEndpoint       string `json:"egress_endpoint,omitempty"`
	EgressConnectTimeout int    `json:"egress_connect_timeout,omitempty"` // seconds
	EgressErrorBackoff   int    `json:"egress_error_backoff,omitempty"`   // seconds
}

UnboundedOutboundOptions configures a consumer-side Unbounded outbound.

The Unbounded outbound establishes a WebRTC data-channel to a volunteer peer (a "producer" running the Unbounded widget in their browser), and tunnels QUIC over that channel. See getlantern/broflake for the full protocol.

Only JSON-serializable fields live here. Runtime-only dependencies — the HTTP transport used for signaling, the current STUN-server list, a logger — are injected from the hosting process (e.g. radiance) via context (adapter.ContextWithDirectTransport) at service startup, not via this struct. This is a deliberate design choice: sing-box's custom marshaler reaches through struct tags and would fail on func or *http.Client fields, and polluting the options struct with runtime-injected plumbing would also break compatibility with stock sing-box.

Time-valued fields are represented as integer seconds. Zero means "use broflake's default"; to disable a timeout rather than default it, pass a large value (e.g. the number of seconds in a year). This matches how broflake's own options types distinguish unset vs. zero.

type WATERDownloadOptions

type WATERDownloadOptions struct {
	// Hashsum is used for validating if the downloaded WASM
	// hasn't been tampered. Expects a sha256 sum.
	Hashsum string `json:"hashsum"`
	// WASMAvailableAt must provide a list of URLs where the WASM file
	// can be downloaded
	WASMAvailableAt []string `json:"wasm_available_at"`
	// DownloadTimeout specifies how much time the downloader should wait
	// until it cancel and try to fetch from another URL
	DownloadTimeout string `json:"download_timeout"`
	// DownloadDetour specifies which outbound tag to use when downloading the WASM file
	DownloadDetour string `json:"download_detour,omitempty"`
}

type WATERInboundOptions

type WATERInboundOptions struct {
	option.ListenOptions
	// Transport works as a identifier for the WASM logs
	Transport string `json:"transport"`
	// Hashsum is used for validating if the downloaded WASM
	// hasn't been tampered. Expects a sha256 sum.
	Hashsum string `json:"hashsum"`
	// WASMAvailableAt must provide a list of URLs where the WASM file
	// can be downloaded
	WASMAvailableAt []string `json:"wasm_available_at"`
	// Config is a optional config that will be sent to the WASM file.
	Config map[string]any `json:"config,omitempty"`
}

WATERInboundOptions specifies the configuration/options for starting a WATER listener

type WATEROutboundOptions

type WATEROutboundOptions struct {
	option.ServerOptions
	option.DialerOptions
	WATEROutboundSeedOptions
	WATERDownloadOptions
	// Transport works as a identifier for the WASM logs
	Transport string `json:"transport"`
	// Dir specifies which directory we should use for storing WATER related
	// files
	Dir string `json:"water_dir"`
	// Config is a optional config that will be sent to the WASM file.
	Config map[string]any `json:"config,omitempty"`
	// SkipHandshake is used when the WATER module deals with the handshake
	// instead of the sing-box WATER transport
	SkipHandshake bool `json:"skip_handshake,omitempty"`
	// Optional configuration for supporting UDP over TCP
	UDPOverTCP *option.UDPOverTCPOptions `json:"udp_over_tcp,omitempty"`
}

WATEROutboundOptions specifies the configuration/options for starting a WATER dialer

type WATEROutboundSeedOptions

type WATEROutboundSeedOptions struct {
	// SeedEnabled enables seeding the used transport
	SeedEnabled bool `json:"seed_enabled,omitempty"`
	// SeedDetour specifies which outbound tag to use when seeding the WASM file
	SeedDetour string `json:"seed_detour,omitempty"`
	// AnnounceList specifies which trackers should be used to announce the file
	AnnounceList [][]string `json:"announce_list,omitempty"`
}

WATEROutboundSeedOptions specifies the seed configuration options

Jump to

Keyboard shortcuts

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