Fix the websocket not working
This commit is contained in:
parent
2d832736df
commit
7f40ec7052
1 changed files with 8 additions and 0 deletions
8
main.go
8
main.go
|
@ -197,6 +197,13 @@ var (
|
||||||
upgrade = websocket.Upgrader{
|
upgrade = websocket.Upgrader{
|
||||||
ReadBufferSize: 1024,
|
ReadBufferSize: 1024,
|
||||||
WriteBufferSize: 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 {
|
type Config struct {
|
||||||
ApiKey string `json:"key"`
|
ApiKey string `json:"key"`
|
||||||
|
Origin string `json:"origin"`
|
||||||
Rate float64 `json:"rate"`
|
Rate float64 `json:"rate"`
|
||||||
Multiplier float64 `json:"multiplier"`
|
Multiplier float64 `json:"multiplier"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue