mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 19:42:20 +00:00
Limit WebRTC UDP ports
This commit is contained in:
parent
19a331b9e0
commit
d46efaae3c
@ -45,7 +45,15 @@ func newPeerHandler(remoteSdp webrtc.SessionDescription) webrtc.SessionDescripti
|
||||
}
|
||||
|
||||
// Create a new PeerConnection
|
||||
api := webrtc.NewAPI(webrtc.WithMediaEngine(mediaEngine))
|
||||
settingsEngine := webrtc.SettingEngine{}
|
||||
if err := settingsEngine.SetEphemeralUDPPortRange(10000, 11000); err != nil {
|
||||
log.Println("Failed to set min/max UDP ports", err)
|
||||
return webrtc.SessionDescription{}
|
||||
}
|
||||
api := webrtc.NewAPI(
|
||||
webrtc.WithMediaEngine(mediaEngine),
|
||||
webrtc.WithSettingEngine(settingsEngine),
|
||||
)
|
||||
peerConnection, err := api.NewPeerConnection(webrtc.Configuration{
|
||||
ICEServers: []webrtc.ICEServer{
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user