Skip to content

Instantly share code, notes, and snippets.

🙈
Lexi is the love of my life, I love her more than she loves me

Sean DuBois Sean-Der

🙈
Lexi is the love of my life, I love her more than she loves me
Block or report user

Report or block Sean-Der

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Sean-Der
Sean-Der / croc.diff
Created Nov 11, 2019
Pion DataChannel Bug + Croc
View croc.diff
diff --git a/src/webrtc/wasm/main.go b/src/webrtc/wasm/main.go
index 6048392..9b4eb6d 100644
--- a/src/webrtc/wasm/main.go
+++ b/src/webrtc/wasm/main.go
@@ -50,9 +50,11 @@ func createOfferer() (pc *webrtc.PeerConnection, err error) {
ordered := false
maxRetransmits := uint16(0)
+ var id uint16 = 5
options := &webrtc.DataChannelInit{
@Sean-Der
Sean-Der / main.go
Created Nov 11, 2019
Working Server + WASM Pion
View main.go
package main
import (
"fmt"
"github.com/pion/webrtc/v2"
)
func main() {
// Create two PeerConnections
View gist:fdf3458b0a322ad4a32d9e0c9d29adfb
package main
import (
"fmt"
"github.com/pion/webrtc/v2"
)
func main() {
// Create two PeerConnections
View dtls.diff
diff --git a/conn.go b/conn.go
index bf5a88e..33c805a 100644
--- a/conn.go
+++ b/conn.go
@@ -500,6 +500,7 @@ func (c *Conn) handleIncomingPacket(buf []byte) (*alert, error) {
}
if h.epoch < c.getRemoteEpoch() {
+ c.log.Debugf("retransmitting, got message from old epoch: %v %v", h.epoch, c.getRemoteEpoch())
if _, alertPtr, err := c.flightHandler(c); err != nil {
View gist:49b3d53d0e2b85d7dff1b82b9f3678ea
diff --git a/conn.go b/conn.go
index 1698b07..c45e131 100644
--- a/conn.go
+++ b/conn.go
@@ -570,6 +570,7 @@ func (c *Conn) handleIncomingPacket(buf []byte) (*alert, error) {
}
if h.epoch < c.getRemoteEpoch() {
+ c.log.Debugf("retransmitting, got message from old epoch: %v %v", h.epoch, c.getRemoteEpoch())
if _, alertPtr, err := c.flightHandler(c); err != nil {
View main.go
package main
import (
"fmt"
"time"
"github.com/pion/webrtc/v2"
"github.com/pion/webrtc/v2/examples/internal/signal"
)
View pion.diff
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"},
View gist:0fac80f8aa0ff9a76ad8daa24b9ed43d
package main
import (
"crypto/tls"
"fmt"
"log"
"net"
"time"
"github.com/pion/logging"
View gist:5a166e16b5383daf3788a776d7845d60
diff --git a/association.go b/association.go
index 2e3aab1..e0ec341 100644
--- a/association.go
+++ b/association.go
@@ -377,6 +377,8 @@ func (a *Association) closeAllTimers() {
a.ackTimer.close()
}
+var conn net.Conn
+
View gist:8677b050486699db61cce8d096dad887
diff --git a/agent.go b/agent.go
index a36423e..bd2c60d 100644
--- a/agent.go
+++ b/agent.go
@@ -596,6 +596,8 @@ func (a *Agent) taskLoop() {
}
} else {
select {
+ case <-a.forceCandidateContact:
+ a.selector.ContactCandidates()
You can’t perform that action at this time.