mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-02 09:52:34 +02:00
fix(websocket): 403 forbidden agent metrics
This commit is contained in:
parent
cb506120dd
commit
4705989f4b
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue