Skip to content

Commit

Permalink
expose the http port in port 80 instead of 443 if not using funnel
Browse files Browse the repository at this point in the history
Signed-off-by: lucasew <lucas59356@gmail.com>
  • Loading branch information
lucasew committed Oct 13, 2024
1 parent e04470b commit 970fb39
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/ts-proxyd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/lucasew/ts-proxy"
"log"
"net/url"
"github.com/davecgh/go-spew/spew"
)

var options tsproxy.TailscaleProxyServerOptions
Expand All @@ -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)
}
Expand Down

0 comments on commit 970fb39

Please sign in to comment.