decouple websocket and RTC nodes, prep for distributed

This commit is contained in:
David Zhao
2021-01-16 10:37:38 -08:00
parent 9a10a57b30
commit 9064f6ade1
61 changed files with 2683 additions and 1361 deletions
+4 -2
View File
@@ -19,7 +19,9 @@ type ReceiverConfig struct {
maxBufferTime int
}
func NewWebRTCConfig(conf *config.RTCConfig, externalIP string) (*WebRTCConfig, error) {
type ExternalIP string
func NewWebRTCConfig(conf *config.RTCConfig, externalIP ExternalIP) (*WebRTCConfig, error) {
c := webrtc.Configuration{
SDPSemantics: webrtc.SDPSemanticsUnifiedPlan,
}
@@ -41,7 +43,7 @@ func NewWebRTCConfig(conf *config.RTCConfig, externalIP string) (*WebRTCConfig,
},
}
if conf.UseExternalIP {
s.SetNAT1To1IPs([]string{externalIP}, webrtc.ICECandidateTypeHost)
s.SetNAT1To1IPs([]string{string(externalIP)}, webrtc.ICECandidateTypeHost)
}
return &WebRTCConfig{