From 24071f92472137256524d1fd35fdb32955765302 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 20 Jan 2020 14:54:56 +0000 Subject: [PATCH] check origin unnecessary for demo --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c2b3394..d844b23 100644 --- a/main.go +++ b/main.go @@ -42,12 +42,15 @@ func load_data(filename string) []dashData { return d } -var upgrader = websocket.Upgrader{} +var upgrader = websocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { + return true + }, +} func main() { http.HandleFunc("/ws", subscribe) log.Fatal(http.ListenAndServe("localhost:9888", nil)) - } func subscribe(w http.ResponseWriter, r *http.Request) {