Refactored some debug functionality, and added CM-to-FSN flag.
This commit is contained in:
@ -19,7 +19,8 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
enableCNDomain = flag.Bool("enable-cn-domain", false, "Enable china mainland specific domain")
|
||||
enableCNDomain = flag.Bool("enable-cn-domain", true, "Enable china mainland specific domain")
|
||||
enableCMExperiment = flag.Bool("cm-to-fsn", false, "Redirect all CM users to Hetzner FSN")
|
||||
)
|
||||
|
||||
// Get returns the edge node that should be used for client.
|
||||
@ -29,6 +30,9 @@ func Get(ip string) string {
|
||||
if err != nil {
|
||||
return default_server + default_suffix
|
||||
}
|
||||
if *enableCMExperiment && info_en.IspDomain == "ChinaMobile" {
|
||||
return HETZNER_FSN_1GE + CHINA_MAINLAND_SUFFIX
|
||||
}
|
||||
if *enableCNDomain && info_en.CountryCode == "CN" {
|
||||
return default_server + CHINA_MAINLAND_SUFFIX
|
||||
}
|
||||
|
Reference in New Issue
Block a user