summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCecylia Bocovich <cohosh@torproject.org>2023-10-03 10:35:17 -0400
committerCecylia Bocovich <cohosh@torproject.org>2023-10-05 17:51:56 -0400
commitd434549df88292ff6e61830dc06a49b0ac1b21c6 (patch)
tree9b317a500400904e4d1d7101cbadd59033a75d01
parent9fdfb3d1b53e9113422a7a2816b2a9af4450b4ac (diff)
downloadsnowflake-d434549df88292ff6e61830dc06a49b0ac1b21c6.tar.gz
snowflake-d434549df88292ff6e61830dc06a49b0ac1b21c6.zip
Maintain backward compatability with old clients
Introduce a new commandline and SOCKS argument for comma-separated domain fronts rather than repurposing the old one so that we can maintain backwards compatability with users running old versions of the client. A new bridge line shared on circumvention settings could have both the front= and fronts= options set.
-rw-r--r--client/snowflake.go12
-rw-r--r--client/torrc4
2 files changed, 12 insertions, 4 deletions
diff --git a/client/snowflake.go b/client/snowflake.go
index d72e33f..f4d9c5f 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -80,7 +80,9 @@ func socksAcceptLoop(ln *pt.SocksListener, config sf.ClientConfig, shutdown chan
if arg, ok := conn.Req.Args.Get("ampcache"); ok {
config.AmpCacheURL = arg
}
- if arg, ok := conn.Req.Args.Get("front"); ok {
+ if arg, ok := conn.Req.Args.Get("fronts"); ok {
+ config.FrontDomains = strings.Split(strings.TrimSpace(arg), ",")
+ } else if arg, ok := conn.Req.Args.Get("front"); ok {
config.FrontDomains = strings.Split(strings.TrimSpace(arg), ",")
}
if arg, ok := conn.Req.Args.Get("ice"); ok {
@@ -151,7 +153,8 @@ func socksAcceptLoop(ln *pt.SocksListener, config sf.ClientConfig, shutdown chan
func main() {
iceServersCommas := flag.String("ice", "", "comma-separated list of ICE servers")
brokerURL := flag.String("url", "", "URL of signaling broker")
- frontDomainsCommas := flag.String("front", "", "comma-separated list of front domains")
+ frontDomain := flag.String("front", "", "front domain")
+ frontDomainsCommas := flag.String("fronts", "", "comma-separated list of front domains")
ampCacheURL := flag.String("ampcache", "", "URL of AMP cache to use as a proxy for signaling")
logFilename := flag.String("log", "", "name of log file")
logToStateDir := flag.Bool("log-to-state-dir", false, "resolve the log file relative to tor's pt state dir")
@@ -208,6 +211,11 @@ func main() {
iceAddresses := strings.Split(strings.TrimSpace(*iceServersCommas), ",")
frontDomains := strings.Split(strings.TrimSpace(*frontDomainsCommas), ",")
+ // Maintain backwards compatability with legacy commandline option
+ if (len(frontDomains) == 0) && (*frontDomain != "") {
+ frontDomains = []string{*frontDomain}
+ }
+
config := sf.ClientConfig{
BrokerURL: *brokerURL,
AmpCacheURL: *ampCacheURL,
diff --git a/client/torrc b/client/torrc
index 6f09bfe..0afe664 100644
--- a/client/torrc
+++ b/client/torrc
@@ -3,7 +3,7 @@ DataDirectory datadir
ClientTransportPlugin snowflake exec ./client -log snowflake.log
-Bridge snowflake 192.0.2.3:80 2B280B23E1107BB62ABFC40DDCC8824814F80A72 fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://snowflake-broker.torproject.net.global.prod.fastly.net/ front=foursquare.com,github.githubassets.com ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn
-Bridge snowflake 192.0.2.4:80 8838024498816A039FCBBAB14E6F40A0843051FA fingerprint=8838024498816A039FCBBAB14E6F40A0843051FA url=https://snowflake-broker.torproject.net.global.prod.fastly.net/ front=foursquare.com,github.githubassets.com ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.net:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn
+Bridge snowflake 192.0.2.3:80 2B280B23E1107BB62ABFC40DDCC8824814F80A72 fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://snowflake-broker.torproject.net.global.prod.fastly.net/ front=foursquare.com fronts=foursquare.com,github.githubassets.com ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.com:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn
+Bridge snowflake 192.0.2.4:80 8838024498816A039FCBBAB14E6F40A0843051FA fingerprint=8838024498816A039FCBBAB14E6F40A0843051FA url=https://snowflake-broker.torproject.net.global.prod.fastly.net/ front=foursquare.com fronts=foursquare.com,github.githubassets.com ice=stun:stun.l.google.com:19302,stun:stun.antisip.com:3478,stun:stun.bluesip.net:3478,stun:stun.dus.net:3478,stun:stun.epygi.com:3478,stun:stun.sonetel.net:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.voys.nl:3478 utls-imitate=hellorandomizedalpn
SocksPort auto