Skip to content

Instantly share code, notes, and snippets.

@Sean-Der
Last active October 8, 2019 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sean-Der/77bafa57ec4afd11d54e4ea6b61b94da to your computer and use it in GitHub Desktop.
Save Sean-Der/77bafa57ec4afd11d54e4ea6b61b94da to your computer and use it in GitHub Desktop.
diff --git a/examples/pion-to-pion/answer/main.go b/examples/pion-to-pion/answer/main.go
index aa44fd7..d6a56e7 100644
--- a/examples/pion-to-pion/answer/main.go
+++ b/examples/pion-to-pion/answer/main.go
@@ -22,9 +22,12 @@ func main() {
config := webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
{
- URLs: []string{"stun:stun.l.google.com:19302"},
+ URLs: []string{"turn:global.turn.twilio.com:443?transport=tcp"},
+ Username: "USERNAME",
+ Credential: "PASSWORD",
},
},
+ ICETransportPolicy: webrtc.ICETransportPolicyRelay,
}
// Create a new RTCPeerConnection
@@ -48,7 +51,7 @@ func main() {
fmt.Printf("Data channel '%s'-'%d' open. Random messages will now be sent to any connected DataChannels every 5 seconds\n", d.Label(), d.ID())
for range time.NewTicker(5 * time.Second).C {
- message := signal.RandSeq(15)
+ message := signal.RandSeq(1)
fmt.Printf("Sending '%s'\n", message)
// Send the message as text
diff --git a/examples/pion-to-pion/offer/main.go b/examples/pion-to-pion/offer/main.go
index dbe9b45..e02e00c 100644
--- a/examples/pion-to-pion/offer/main.go
+++ b/examples/pion-to-pion/offer/main.go
@@ -23,9 +23,12 @@ func main() {
config := webrtc.Configuration{
ICEServers: []webrtc.ICEServer{
{
- URLs: []string{"stun:stun.l.google.com:19302"},
+ URLs: []string{"turn:global.turn.twilio.com:443?transport=tcp"},
+ Username: "USERNAME",
+ Credential: "PASSWORD",
},
},
+ ICETransportPolicy: webrtc.ICETransportPolicyRelay,
}
// Create a new RTCPeerConnection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment