check origin unnecessary for demo
This commit is contained in:
parent
2f16eac316
commit
24071f9247
7
main.go
7
main.go
|
@ -42,12 +42,15 @@ func load_data(filename string) []dashData {
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
var upgrader = websocket.Upgrader{}
|
var upgrader = websocket.Upgrader{
|
||||||
|
CheckOrigin: func(r *http.Request) bool {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
http.HandleFunc("/ws", subscribe)
|
http.HandleFunc("/ws", subscribe)
|
||||||
log.Fatal(http.ListenAndServe("localhost:9888", nil))
|
log.Fatal(http.ListenAndServe("localhost:9888", nil))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func subscribe(w http.ResponseWriter, r *http.Request) {
|
func subscribe(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
Loading…
Reference in New Issue