main: show message when listening on network (#836)

fixes: #739
This commit is contained in:
Benson Wong
2026-06-11 22:15:14 -07:00
committed by GitHub
parent 9b3a33d7b9
commit f6877b8175
2 changed files with 38 additions and 0 deletions
+7
View File
@@ -6,6 +6,7 @@ import (
"flag"
"fmt"
"log/slog"
"net"
"net/http"
"os"
"os/signal"
@@ -53,6 +54,7 @@ var logTimeFormats = map[string]string{
"stampnano": time.StampNano,
}
func main() {
flagConfig := flag.String("config", "", "path to config file (required)")
flagListen := flag.String("listen", "", "listen address (default :8080 or :8443 for TLS)")
@@ -262,6 +264,11 @@ func main() {
}
}()
if !shared.IsLoopbackAddr(listenAddr) {
_, port, _ := net.SplitHostPort(listenAddr)
proxyLog.Infof("llama-swap is reachable by all hosts on the network, use -listen localhost:%s to restrict to loopback only", port)
}
exitChan := make(chan struct{})
go func() {