mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-10 06:42:36 +02:00
enable WebRTC legacy conditionally.
This commit is contained in:
parent
8f693fc379
commit
f8e9c20ff1
1 changed files with 11 additions and 8 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/pion/webrtc/v3"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"m1k1o/neko/internal/config"
|
||||
"m1k1o/neko/internal/webrtc/cursor"
|
||||
|
@ -476,6 +477,7 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session) (*webrtc.Sess
|
|||
// new implementation creates a new data channel on server side
|
||||
//
|
||||
|
||||
if viper.GetBool("legacy") {
|
||||
// handle legacy data channel
|
||||
dc.OnMessage(func(message webrtc.DataChannelMessage) {
|
||||
if err := manager.handleLegacy(logger, message.Data, session); err != nil {
|
||||
|
@ -485,6 +487,7 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session) (*webrtc.Sess
|
|||
|
||||
// handle legacy data channel
|
||||
peer.dataChannel = dc
|
||||
}
|
||||
})
|
||||
|
||||
var once sync.Once
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue