use protobuf for clients with protocol > 1 (#52)

This commit is contained in:
David Zhao
2021-07-13 22:28:34 -07:00
committed by GitHub
parent 850fecf931
commit 53b52a67ca
3 changed files with 14 additions and 4 deletions
+4
View File
@@ -8,6 +8,7 @@ import (
"strings"
"github.com/gorilla/websocket"
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/logger"
@@ -126,6 +127,9 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
sigConn := NewWSSignalConnection(conn)
if types.ProtocolVersion(pi.ProtocolVersion).SupportsProtobuf() {
sigConn.useJSON = false
}
logger.Infow("new client WS connected",
"connectionId", connId,