Update webrtc library to v3.0.0

This update required two main changes to how we use the library. First,
we had to make sure we created the datachannel on the offering peer side
before creating the offer. Second, we had to make sure we wait for the
gathering of all candidates to complete since trickle-ice is enabled by
default. See the release notes for more details:
https://github.com/pion/webrtc/wiki/Release-WebRTC@v3.0.0.
This commit is contained in:
Cecylia Bocovich 2020-12-17 12:25:11 -05:00
parent f908576c60
commit 83c01565ef
9 changed files with 174 additions and 136 deletions

View file

@ -21,7 +21,7 @@ import (
"git.torproject.org/pluggable-transports/snowflake.git/common/nat"
"git.torproject.org/pluggable-transports/snowflake.git/common/util"
"github.com/pion/webrtc/v2"
"github.com/pion/webrtc/v3"
)
const (
@ -134,6 +134,7 @@ func (bc *BrokerChannel) Negotiate(offer *webrtc.SessionDescription) (
if nil != err {
return nil, err
}
log.Printf("Received answer: %s", string(body))
return util.DeserializeSessionDescription(string(body))
case http.StatusServiceUnavailable:
return nil, errors.New(BrokerError503)