add Trickle ICE support.

This commit is contained in:
Miroslav Šedivý 2021-02-02 20:43:33 +01:00
parent dd4c67a6c4
commit cae8201908
9 changed files with 68 additions and 17 deletions

View file

@ -7,9 +7,10 @@ const (
)
const (
SIGNAL_REQUEST = "signal/request"
SIGNAL_ANSWER = "signal/answer"
SIGNAL_PROVIDE = "signal/provide"
SIGNAL_REQUEST = "signal/request"
SIGNAL_ANSWER = "signal/answer"
SIGNAL_PROVIDE = "signal/provide"
SIGNAL_CANDIDATE = "signal/candidate"
)
const (

View file

@ -1,6 +1,8 @@
package message
import (
"github.com/pion/webrtc/v3"
"demodesk/neko/internal/types"
)
@ -45,6 +47,11 @@ type SignalProvide struct {
ICE []string `json:"ice"`
}
type SignalCandidate struct {
Event string `json:"event,omitempty"`
*webrtc.ICECandidateInit
}
type SignalAnswer struct {
Event string `json:"event,omitempty"`
SDP string `json:"sdp"`

View file

@ -1,6 +1,10 @@
package types
import "net/http"
import (
"net/http"
"github.com/pion/webrtc/v3"
)
type MemberProfile struct {
Secret string `json:"secret,omitempty"`
@ -58,6 +62,7 @@ type Session interface {
SetWebRTCPeer(webrtc_peer WebRTCPeer)
SetWebRTCConnected(connected bool)
SignalAnswer(sdp string) error
SignalCandidate(candidate webrtc.ICECandidateInit) error
}
type SessionManager interface {

View file

@ -4,6 +4,8 @@ import "github.com/pion/webrtc/v3"
type WebRTCPeer interface {
SignalAnswer(sdp string) error
SignalCandidate(candidate webrtc.ICECandidateInit) error
Destroy() error
}