mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
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.
This commit is contained in:
parent
9fdfb3d1b5
commit
d434549df8
2 changed files with 12 additions and 4 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue