From 7f40ec7052be7ad570cd4f713353e29ace714b9a Mon Sep 17 00:00:00 2001 From: arzumify <jliwin98@danwin1210.de> Date: Mon, 24 Mar 2025 19:00:27 +0000 Subject: [PATCH] Fix the websocket not working --- main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.go b/main.go index dd0bbe7..42164fd 100644 --- a/main.go +++ b/main.go @@ -197,6 +197,13 @@ var ( upgrade = websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 1024, + CheckOrigin: func(r *http.Request) bool { + if r.Header.Get("Origin") == configFile.Origin { + return true + } else { + return false + } + }, } ) @@ -275,6 +282,7 @@ type Bet struct { type Config struct { ApiKey string `json:"key"` + Origin string `json:"origin"` Rate float64 `json:"rate"` Multiplier float64 `json:"multiplier"` }