From 008622cf70fdb684b4bc3da120fd6eaddaab33a3 Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Thu, 21 Jun 2018 14:47:12 +0100 Subject: [PATCH] handling cors origin --- handler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handler.go b/handler.go index ed6e2ca..10997b1 100644 --- a/handler.go +++ b/handler.go @@ -13,7 +13,11 @@ import ( "github.com/r3labs/broadcast" ) -var upgrader = websocket.Upgrader{} +var upgrader = websocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { + return true + }, +} func handler(w http.ResponseWriter, r *http.Request) { c, err := upgrader.Upgrade(w, r, nil)