Documentation ¶
Overview ¶
Package snowflake_proxy provides functionality for creating, starting, and stopping a snowflake proxy.
To run a proxy, you must first create a proxy configuration. Unconfigured fields will be set to the defined defaults.
proxy := snowflake_proxy.SnowflakeProxy{ BrokerURL: "https://snowflake-broker.example.com", STUNURL: "stun:stun.stunprotocol.org:3478", // ... }
You may then start and stop the proxy. Stopping the proxy will close existing connections and the proxy will not poll for more clients.
go func() { err := proxy.Start() // handle error } // ... proxy.Stop()
Index ¶
Constants ¶
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" )
const DefaultBrokerURL = "https://snowflake-broker.torproject.net/"
const DefaultNATProbeURL = "https://snowflake-broker.torproject.net:8443/probe"
const DefaultRelayURL = "wss://snowflake.bamsoftware.com/"
const DefaultSTUNURL = "stun:stun.stunprotocol.org:3478"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SignalingServer ¶
type SignalingServer struct {
// contains filtered or unexported fields
}
SignalingServer keeps track of the SignalingServer in use by the Snowflake
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 // NATProbeURL is the URL of the probe service we use for NAT checks NATProbeURL string // 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.