diff --git a/cmd/ts-proxyd/main.go b/cmd/ts-proxyd/main.go index 33080af..d509c45 100644 --- a/cmd/ts-proxyd/main.go +++ b/cmd/ts-proxyd/main.go @@ -5,6 +5,7 @@ import ( "github.com/lucasew/ts-proxy" "log" "net/url" + "github.com/davecgh/go-spew/spew" ) var options tsproxy.TailscaleProxyServerOptions @@ -16,9 +17,15 @@ func init() { flag.BoolVar(&options.EnableFunnel, "f", false, "Enable tailscale funnel") flag.StringVar(&options.Hostname, "n", "", "Hostname in tailscale devices list") flag.StringVar(&options.StateDir, "s", "", "State directory") - flag.StringVar(&options.Addr, "addr", ":443", "Port to listen") + flag.Parse() + defaultPort := ":80" + if options.EnableFunnel { + defaultPort = ":443" + } + flag.StringVar(&options.Addr, "addr", defaultPort, "Port to listen") flag.Parse() options.Upstream, err = url.Parse(remoteHost) + spew.Dump(options) if err != nil { log.Fatal(err) }