mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
refactor(proxy): better RelayURL
description
It's the case that it's simply "default" after https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/87 Now the broker specifies the relay URL (see `ProxyPollResponse`).
This commit is contained in:
parent
ec9476e5ab
commit
2bbd4d0643
2 changed files with 10 additions and 7 deletions
|
@ -56,9 +56,10 @@ const (
|
|||
DefaultPollInterval = 5 * time.Second
|
||||
DefaultBrokerURL = "https://snowflake-broker.torproject.net/"
|
||||
DefaultNATProbeURL = "https://snowflake-broker.torproject.net:8443/probe"
|
||||
DefaultRelayURL = "wss://snowflake.torproject.net/"
|
||||
DefaultSTUNURL = "stun:stun.l.google.com:19302"
|
||||
DefaultProxyType = "standalone"
|
||||
// This is rather a "DefaultDefaultRelayURL"
|
||||
DefaultRelayURL = "wss://snowflake.torproject.net/"
|
||||
DefaultSTUNURL = "stun:stun.l.google.com:19302"
|
||||
DefaultProxyType = "standalone"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -125,7 +126,9 @@ type SnowflakeProxy struct {
|
|||
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 is the default `URL` of the server (relay)
|
||||
// that this proxy will forward client connections to,
|
||||
// in case the broker itself did not specify the said URL
|
||||
RelayURL string
|
||||
// OutboundAddress specify an IP address to use as SDP host candidate
|
||||
OutboundAddress string
|
||||
|
@ -728,7 +731,7 @@ func (sf *SnowflakeProxy) Start() error {
|
|||
}
|
||||
_, err = url.Parse(sf.RelayURL)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid relay url: %s", err)
|
||||
return fmt.Errorf("invalid default relay url: %s", err)
|
||||
}
|
||||
|
||||
if !namematcher.IsValidRule(sf.RelayDomainNamePattern) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue