Skip to content

Instantly share code, notes, and snippets.

@Sean-Der Sean-Der/pion.diff
Last active Oct 8, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.