Add NAT Type measurement command line flag

It is important to include unit in flag name to prevent user from making mistake.
This commit is contained in:
Shelikhoo 2021-11-04 20:25:50 +00:00
parent 4c8a166178
commit ac97ce7136
No known key found for this signature in database
GPG key ID: C4D5E79D22B25316
2 changed files with 7 additions and 1 deletions

View file

@ -105,7 +105,9 @@ type SnowflakeProxy struct {
RelayURL string
// NATProbeURL is the URL of the probe service we use for NAT checks
NATProbeURL string
shutdown chan struct{}
// NATTypeMeasurementIntervalSecond is time in second before NAT type is retested
NATTypeMeasurementIntervalSecond uint
shutdown chan struct{}
}
// Checks whether an IP address is a remote address for the client

View file

@ -18,6 +18,8 @@ func main() {
unsafeLogging := flag.Bool("unsafe-logging", false, "prevent logs from being scrubbed")
keepLocalAddresses := flag.Bool("keep-local-addresses", false, "keep local LAN address ICE candidates")
relayURL := flag.String("relay", sf.DefaultRelayURL, "websocket relay URL")
NATTypeMeasurementIntervalSecond := flag.Uint("nat-type-measurement-interval-second", 0,
"the time interval in second before NAT type is retested, 0 disables retest")
flag.Parse()
@ -27,6 +29,8 @@ func main() {
BrokerURL: *rawBrokerURL,
KeepLocalAddresses: *keepLocalAddresses,
RelayURL: *relayURL,
NATTypeMeasurementIntervalSecond: *NATTypeMeasurementIntervalSecond,
}
var logOutput io.Writer = os.Stderr