mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-27 02:38:33 +02:00
fix(websocket): 403 forbidden agent metrics
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/yusing/go-proxy/agent/pkg/agent"
|
||||||
)
|
)
|
||||||
|
|
||||||
func warnNoMatchDomains() {
|
func warnNoMatchDomains() {
|
||||||
@@ -53,7 +54,7 @@ func Initiate(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
host = r.Host
|
host = r.Host
|
||||||
}
|
}
|
||||||
if host == "localhost" {
|
if host == "localhost" || host == agent.AgentHost {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
ip := net.ParseIP(host)
|
ip := net.ParseIP(host)
|
||||||
|
|||||||
Reference in New Issue
Block a user