mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Randomly select front domain from comma-separated list
This commmit changes the command-line and Bridge line arguments to take a comma-separated list of front domains. The change is backwards compatible with old Bridge and ClientTransportPlugin lines. At rendezvous time, a front domain will be randomly chosen from the list.
This commit is contained in:
parent
5cdf52c813
commit
9fdfb3d1b5
7 changed files with 65 additions and 48 deletions
|
@ -64,8 +64,8 @@ func createBrokerTransport() http.RoundTripper {
|
|||
func newBrokerChannelFromConfig(config ClientConfig) (*BrokerChannel, error) {
|
||||
log.Println("Rendezvous using Broker at:", config.BrokerURL)
|
||||
|
||||
if config.FrontDomain != "" {
|
||||
log.Println("Domain fronting using:", config.FrontDomain)
|
||||
if len(config.FrontDomains) != 0 {
|
||||
log.Printf("Domain fronting using a randomly selected domain from: %v", config.FrontDomains)
|
||||
}
|
||||
|
||||
brokerTransport := createBrokerTransport()
|
||||
|
@ -86,11 +86,11 @@ func newBrokerChannelFromConfig(config ClientConfig) (*BrokerChannel, error) {
|
|||
if config.AmpCacheURL != "" {
|
||||
log.Println("Through AMP cache at:", config.AmpCacheURL)
|
||||
rendezvous, err = newAMPCacheRendezvous(
|
||||
config.BrokerURL, config.AmpCacheURL, config.FrontDomain,
|
||||
config.BrokerURL, config.AmpCacheURL, config.FrontDomains,
|
||||
brokerTransport)
|
||||
} else {
|
||||
rendezvous, err = newHTTPRendezvous(
|
||||
config.BrokerURL, config.FrontDomain, brokerTransport)
|
||||
config.BrokerURL, config.FrontDomains, brokerTransport)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue