allow websocket connections cross-origin

This commit is contained in:
Brad Rydzewski
2015-04-30 00:24:39 -07:00
parent 77246cc9c9
commit 3863617056

View File

@@ -2,6 +2,7 @@ package server
import ( import (
"fmt" "fmt"
"net/http"
"net/url" "net/url"
"strconv" "strconv"
"time" "time"
@@ -29,6 +30,7 @@ const (
var upgrader = websocket.Upgrader{ var upgrader = websocket.Upgrader{
ReadBufferSize: 1024, ReadBufferSize: 1024,
WriteBufferSize: 1024, WriteBufferSize: 1024,
CheckOrigin: func(r *http.Request) bool { return true },
} }
// GetEvents will upgrade the connection to a Websocket and will stream // GetEvents will upgrade the connection to a Websocket and will stream