refraction

package
v2.0.15+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCachedConjureRegistration

func DeleteCachedConjureRegistration(_ *ConjureConfig)

func DialConjure

func DialConjure(_ context.Context, _ bool, _ string, _ common.NetDialer, _ string, _ *ConjureConfig) (net.Conn, error)

DialConjure establishes a new Conjure connection to a Conjure station.

func DialTapDance

func DialTapDance(_ context.Context, _ bool, _ string, _ common.NetDialer, _ string) (net.Conn, error)

DialTapDance establishes a new Tapdance connection to a Tapdance station.

func Enabled

func Enabled() bool

Enabled indicates if Refraction Networking functionality is enabled.

func Listen

func Listen(_ string) (net.Listener, error)

Listen creates a new Refraction Networking listener.

Types

type ConjureConfig

type ConjureConfig struct {

	// RegistrationCacheTTL specifies how long to retain a successful Conjure
	// registration for reuse in a subsequent dial. This value should be
	// synchronized with the Conjure station configuration. When
	// RegistrationCacheTTL is 0, registrations are not cached.
	RegistrationCacheTTL time.Duration

	// RegistrationCacheKey defines a scope or affinity for cached Conjure
	// registrations. For example, the key can reflect the target Psiphon server
	// as well as the current network ID. This ensures that any replay will
	// always use the same cached registration, including its phantom IP(s). And
	// ensures that the cache scope is restricted to the current network: when
	// the network changes, the client's public IP changes, and previous
	// registrations will become invalid. When the client returns to the original
	// network, the previous registrations may be valid once again (assuming
	// the client reverts back to its original public IP).
	RegistrationCacheKey string

	// APIRegistrarURL specifies the API registration endpoint. Setting
	// APIRegistrarURL enables API registration. The domain fronting
	// configuration provided by APIRegistrarHTTPClient may ignore the host
	// portion of this URL, implicitly providing another value; the path portion
	// is always used in the request. Only one of API registration or decoy
	// registration can be enabled for a single dial.
	APIRegistrarURL string

	// APIRegistrarHTTPClient specifies a custom HTTP client (and underlying
	// dialers) to be used for Conjure API registration. The
	// APIRegistrarHTTPClient enables domain fronting of API registration web
	// requests. This parameter is required when API registration is enabled.
	APIRegistrarHTTPClient *http.Client

	// APIRegistrarDelay specifies how long to wait after a successful API
	// registration before initiating the phantom dial(s), as required by the
	// Conjure protocol. This value depends on Conjure station operations and
	// should be synchronized with the Conjure station configuration.
	APIRegistrarDelay time.Duration

	// DecoyRegistrarDialer specifies a custom dialer to be used for decoy
	// registration. Only one of API registration or decoy registration can be
	// enabled for a single dial.
	DecoyRegistrarDialer common.NetDialer

	// DecoyRegistrarWidth specifies how many decoys to use per registration.
	DecoyRegistrarWidth int

	// DecoyRegistrarDelay specifies how long to wait after a successful API
	// registration before initiating the phantom dial(s), as required by the
	// Conjure protocol.
	//
	// Limitation: this value is not exposed by gotapdance and is currently
	// ignored.
	DecoyRegistrarDelay time.Duration

	// Transport may be protocol.CONJURE_TRANSPORT_MIN_OSSH or
	// protocol.CONJURE_TRANSPORT_OBFS4_OSSH.
	Transport string

	// DiagnosticID identifies this dial in diagnostics.
	DiagnosticID string

	// Logger is used for logging diagnostics.
	Logger common.Logger
}

ConjureConfig specifies the additional configuration for a Conjure dial.

type Listener

type Listener struct {
	net.Listener
}

Listener is a net.Listener.

Jump to

Keyboard shortcuts

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