lib

package
v0.0.0-...-b0b2541 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT, BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NATUnknown represents a NAT type which is unknown.
	NATUnknown = "unknown"
	// NATRestricted represents a restricted NAT.
	NATRestricted = "restricted"
	// NATUnrestricted represents an unrestricted NAT.
	NATUnrestricted = "unrestricted"
)
View Source
const DefaultBrokerURL = "https://snowflake-broker.torproject.net/"
View Source
const DefaultNATProbeURL = "https://snowflake-broker.torproject.net:8443/probe"
View Source
const DefaultProxyType = "standalone"
View Source
const DefaultRelayURL = "wss://snowflake.bamsoftware.com/"
View Source
const DefaultSTUNURL = "stun:stun.stunprotocol.org:3478"

Variables

This section is empty.

Functions

func NewProxyEventLogger

func NewProxyEventLogger(logPeriod time.Duration, output io.Writer) event.SnowflakeEventReceiver

func SendCurrent

func SendCurrent() (int64, int64)

func SendStatSum

func SendStatSum() (int64, int64, int)

Types

type SignalingServer

type SignalingServer struct {
	// contains filtered or unexported fields
}

SignalingServer keeps track of the SignalingServer in use by the Snowflake

func (*SignalingServer) Post

func (s *SignalingServer) Post(path string, payload io.Reader) ([]byte, error)

Post sends a POST request to the SignalingServer

type SnowflakeProxy

type SnowflakeProxy struct {
	// Capacity is the maximum number of clients a Snowflake will serve.
	// Proxies with a capacity of 0 will accept an unlimited number of clients.
	Capacity uint
	// STUNURL is the URL of the STUN server the proxy will use
	STUNURL string
	// BrokerURL is the URL of the Snowflake broker
	BrokerURL string
	// KeepLocalAddresses indicates whether local SDP candidates will be sent to the broker
	KeepLocalAddresses bool
	// RelayURL is the URL of the Snowflake server that all traffic will be relayed to
	RelayURL string
	// Ephemeral*Port limits the pool of ports that ICE UDP connections can allocate from
	EphemeralMinPort uint16
	EphemeralMaxPort uint16
	// RelayDomainNamePattern is the pattern specify allowed domain name for relay
	// If the pattern starts with ^ then an exact match is required.
	// The rest of pattern is the suffix of domain name.
	// There is no look ahead assertion when matching domain name suffix,
	// thus the string prepend the suffix does not need to be empty or ends with a dot.
	RelayDomainNamePattern string
	AllowNonTLSRelay       bool
	// NATProbeURL is the URL of the probe service we use for NAT checks
	NATProbeURL string
	// NATTypeMeasurementInterval is time before NAT type is retested
	NATTypeMeasurementInterval time.Duration
	// ProxyType is the type reported to the broker, if not provided it "standalone" will be used
	ProxyType       string
	EventDispatcher event.SnowflakeEventDispatcher
	// contains filtered or unexported fields
}

SnowflakeProxy is used to configure an embedded Snowflake in another Go application.

func (*SnowflakeProxy) Start

func (sf *SnowflakeProxy) Start() error

Start configures and starts a Snowflake, fully formed and special. Configuration values that are unset will default to their corresponding default values.

func (*SnowflakeProxy) Stop

func (sf *SnowflakeProxy) Stop()

Stop closes all existing connections and shuts down the Snowflake.

Jump to

Keyboard shortcuts

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