diff --git a/pkg/service/rtcservice.go b/pkg/service/rtcservice.go index a532fb71..7451d576 100644 --- a/pkg/service/rtcservice.go +++ b/pkg/service/rtcservice.go @@ -69,7 +69,6 @@ func NewRTCService( router: router, roomAllocator: ra, store: store, - upgrader: websocket.Upgrader{}, currentNode: currentNode, config: conf, isDev: conf.Development, @@ -79,10 +78,14 @@ func NewRTCService( connections: map[*websocket.Conn]struct{}{}, } - // allow connections from any origin, since script may be hosted anywhere - // security is enforced by access tokens - s.upgrader.CheckOrigin = func(r *http.Request) bool { - return true + s.upgrader = websocket.Upgrader{ + EnableCompression: true, + + // allow connections from any origin, since script may be hosted anywhere + // security is enforced by access tokens + CheckOrigin: func(r *http.Request) bool { + return true + }, } return s