TUN-3757: Fix legacy Uint flags that are incorrectly handled by ufarve library

The following UInt flags:
 * Uint64 - heartbeat-count, compression-quality
 * Uint - retries, port, proxy-port

were not being correctly picked from the configuration YAML
since the multi origin refactor

This is due to a limitation of the ufarve library, which we
overcome for now with handling those as Int flags.
This commit is contained in:
Nuno Diegues
2021-01-14 13:08:55 +00:00
parent 391facbedf
commit 7c3ceeeaef
4 changed files with 18 additions and 8 deletions

View File

@@ -50,6 +50,7 @@ func Command(hidden bool) *cli.Command {
Value: "localhost",
EnvVars: []string{"TUNNEL_DNS_ADDRESS"},
},
// Note TUN-3758 , we use Int because UInt is not supported with altsrc
&cli.IntFlag{
Name: "port",
Usage: "Listen on given port for the DNS over HTTPS proxy server.",
@@ -87,7 +88,8 @@ func Run(c *cli.Context) error {
listener, err := CreateListener(
c.String("address"),
uint16(c.Uint("port")),
// Note TUN-3758 , we use Int because UInt is not supported with altsrc
uint16(c.Int("port")),
c.StringSlice("upstream"),
c.StringSlice("bootstrap"),
log,