fix(websocket): 403 forbidden agent metrics

This commit is contained in:
yusing 2025-06-01 00:31:56 +08:00
parent cb506120dd
commit 4705989f4b

View file

@ -9,6 +9,7 @@ import (
"github.com/gorilla/websocket"
"github.com/rs/zerolog/log"
"github.com/yusing/go-proxy/agent/pkg/agent"
)
func warnNoMatchDomains() {
@ -53,7 +54,7 @@ func Initiate(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error) {
if err != nil {
host = r.Host
}
if host == "localhost" {
if host == "localhost" || host == agent.AgentHost {
return true
}
ip := net.ParseIP(host)