fix: small fixes

This commit is contained in:
redtea committed 2026-10-13 19:00:50 +03:00
1 parent 86cb0226ab
commit 171e14176a
28 files changed
+95 -91

No files matched your search

+4 -2
View File
@@ -10,9 +10,11 @@ import (
"net/url"
"os"
"os/signal"
"strconv"
"syscall"
"github.com/x-grk/longpolling-remote-access/internal/agent"
"github.com/x-grk/longpolling-remote-access/internal/tunnel"
)
func main() {
@@ -48,7 +50,7 @@ func envOr(key, def string) string {
return def
}
// tunnelAddr derives the direct-tunnel address (host:8446) from the server URL.
// tunnelAddr derives the direct-tunnel address (host:port) from the server URL.
// It is only the starting point: the agent follows the host and port set in
// the panel settings, unless TUNNEL_ADDR (the whole address) or TUNNEL_PORT
// (just the port) pins it here. Set TUNNEL_ADDR=off to disable the tunnel.
@@ -63,5 +65,5 @@ func tunnelAddr(hostURL string) string {
if err != nil || u.Hostname() == "" {
return ""
}
return net.JoinHostPort(u.Hostname(), envOr("TUNNEL_PORT", "8446"))
return net.JoinHostPort(u.Hostname(), envOr("TUNNEL_PORT", strconv.Itoa(tunnel.DefaultPort)))
}