mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Update comments for exported items
This commit is contained in:
parent
84e8a183e5
commit
0e8d41ba4b
1 changed files with 22 additions and 24 deletions
|
@ -2,7 +2,8 @@
|
||||||
Package snowflake_proxy provides functionality for creating, starting, and stopping a snowflake
|
Package snowflake_proxy provides functionality for creating, starting, and stopping a snowflake
|
||||||
proxy.
|
proxy.
|
||||||
|
|
||||||
To run a proxy, you must first create a proxy configuration
|
To run a proxy, you must first create a proxy configuration. Unconfigured fields
|
||||||
|
will be set to the defined defaults.
|
||||||
|
|
||||||
proxy := snowflake_proxy.SnowflakeProxy{
|
proxy := snowflake_proxy.SnowflakeProxy{
|
||||||
BrokerURL: "https://snowflake-broker.example.com",
|
BrokerURL: "https://snowflake-broker.example.com",
|
||||||
|
@ -45,24 +46,16 @@ import (
|
||||||
"github.com/pion/webrtc/v3"
|
"github.com/pion/webrtc/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultBrokerURL is the bamsoftware.com broker, https://snowflake-broker.bamsoftware.com
|
// DefaultBrokerURL is the snowflake broker run at https://snowflake-broker.torproject.net
|
||||||
// Changing this will change the default broker. The recommended way of changing
|
const DefaultBrokerURL = "https://snowflake-broker.torproject.net/"
|
||||||
// the broker that gets used is by passing an argument to Main.
|
|
||||||
const DefaultBrokerURL = "https://snowflake-broker.bamsoftware.com/"
|
|
||||||
|
|
||||||
// DefaultProbeURL is the torproject.org ProbeURL, https://snowflake-broker.torproject.net:8443/probe
|
// DefaultProbeURL is run at https://snowflake-broker.torproject.net:8443/probe
|
||||||
// Changing this will change the default Probe URL. The recommended way of changing
|
|
||||||
// the probe that gets used is by passing an argument to Main.
|
|
||||||
const DefaultProbeURL = "https://snowflake-broker.torproject.net:8443/probe"
|
const DefaultProbeURL = "https://snowflake-broker.torproject.net:8443/probe"
|
||||||
|
|
||||||
// DefaultRelayURL is the bamsoftware.com Websocket Relay, wss://snowflake.bamsoftware.com/
|
// DefaultRelayURL is run at wss://snowflake.torproject.net
|
||||||
// Changing this will change the default Relay URL. The recommended way of changing
|
|
||||||
// the relay that gets used is by passing an argument to Main.
|
|
||||||
const DefaultRelayURL = "wss://snowflake.bamsoftware.com/"
|
const DefaultRelayURL = "wss://snowflake.bamsoftware.com/"
|
||||||
|
|
||||||
// DefaultSTUNURL is a stunprotocol.org STUN URL. stun:stun.stunprotocol.org:3478
|
// DefaultSTUNURL is run at stun:stun.stunprotocol.org:3478
|
||||||
// Changing this will change the default STUN URL. The recommended way of changing
|
|
||||||
// the STUN Server that gets used is by passing an argument to Main.
|
|
||||||
const DefaultSTUNURL = "stun:stun.stunprotocol.org:3478"
|
const DefaultSTUNURL = "stun:stun.stunprotocol.org:3478"
|
||||||
const pollInterval = 5 * time.Second
|
const pollInterval = 5 * time.Second
|
||||||
|
|
||||||
|
@ -95,13 +88,19 @@ var (
|
||||||
client http.Client
|
client http.Client
|
||||||
)
|
)
|
||||||
|
|
||||||
// SnowflakeProxy is a structure which is used to configure an embedded
|
// SnowflakeProxy is used to configure an embedded
|
||||||
// Snowflake in another Go application.
|
// Snowflake in another Go application.
|
||||||
type SnowflakeProxy struct {
|
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
|
Capacity uint
|
||||||
|
// STUNURL is the URL of the STUN server the proxy will use
|
||||||
STUNURL string
|
STUNURL string
|
||||||
|
// BrokerURL is the URL of the Snowflake broker
|
||||||
BrokerURL string
|
BrokerURL string
|
||||||
|
// KeepLocalAddresses indicates whether local SDP candidates will be sent to the broker
|
||||||
KeepLocalAddresses bool
|
KeepLocalAddresses bool
|
||||||
|
// RelayURL is the URL of the Snowflake server that all traffic will be relayed to
|
||||||
RelayURL string
|
RelayURL string
|
||||||
shutdown chan struct{}
|
shutdown chan struct{}
|
||||||
}
|
}
|
||||||
|
@ -485,9 +484,8 @@ func (sf *SnowflakeProxy) runSession(sid string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start configures and starts a Snowflake, fully formed and special. In the
|
// Start configures and starts a Snowflake, fully formed and special. Configuration
|
||||||
// case of an empty map, defaults are configured automatically and can be
|
// values that are unset will default to their corresponding default values.
|
||||||
// found in the GoDoc and in main.go
|
|
||||||
func (sf *SnowflakeProxy) Start() {
|
func (sf *SnowflakeProxy) Start() {
|
||||||
|
|
||||||
sf.shutdown = make(chan struct{})
|
sf.shutdown = make(chan struct{})
|
||||||
|
@ -539,7 +537,7 @@ func (sf *SnowflakeProxy) Start() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop calls close on the sf.shutdown channel shutting down the Snowflake.
|
// Stop closes all existing connections and shuts down the Snowflake.
|
||||||
func (sf *SnowflakeProxy) Stop() {
|
func (sf *SnowflakeProxy) Stop() {
|
||||||
close(sf.shutdown)
|
close(sf.shutdown)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue