Skip to content

Instantly share code, notes, and snippets.

@Sean-Der Sean-Der/croc.diff
Created Nov 11, 2019

Embed
What would you like to do?
Pion DataChannel Bug + Croc
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{
Ordered: &ordered,
MaxRetransmits: &maxRetransmits,
+ ID: &id,
}
sendMoreCh := make(chan struct{})
@@ -128,6 +130,8 @@ func main() {
log.Error(err)
}
+ offerstring := "eyJ0eXBlIjoib2ZmZXIiLCJzZHAiOiJ2PTBcclxubz0tIDI1MTgwOTgwOCAxNTczNTA2MDk0IElOIElQNCAwLjAuMC4wXHJcbnM9LVxyXG50PTAgMFxyXG5hPWZpbmdlcnByaW50OnNoYS0yNTYgODM6QUI6NUY6M0E6QUQ6OTk6Q0U6Mzc6RDg6RTA6OTU6RjQ6MEM6N0M6Qzk6MzI6MzY6ODg6RDk6OUU6MDY6NTk6Qjk6NDE6ODU6RDI6NUY6N0Y6OTI6NUI6MkE6RTNcclxuYT1ncm91cDpCVU5ETEUgMFxyXG5tPWFwcGxpY2F0aW9uIDkgRFRMUy9TQ1RQIDUwMDBcclxuYz1JTiBJUDQgMC4wLjAuMFxyXG5hPXNldHVwOmFjdHBhc3NcclxuYT1taWQ6MFxyXG5hPXNlbmRyZWN2XHJcbmE9c2N0cG1hcDo1MDAwIHdlYnJ0Yy1kYXRhY2hhbm5lbCAxMDI0XHJcbmE9aWNlLXVmcmFnOk1CbklmYUpOSE5id3dZcktcclxuYT1pY2UtcHdkOlFNRlRGYmRnQmNOVVFQR1RQcmFJR2Vjenl3b3FoYk13XHJcbmE9Y2FuZGlkYXRlOmZvdW5kYXRpb24gMSB1ZHAgMjEzMDcwNjQzMSAxMC4xMTEuMTQ0LjE3MCA1MjM3MCB0eXAgaG9zdCBnZW5lcmF0aW9uIDBcclxuYT1jYW5kaWRhdGU6Zm91bmRhdGlvbiAyIHVkcCAyMTMwNzA2NDMxIDEwLjExMS4xNDQuMTcwIDUyMzcwIHR5cCBob3N0IGdlbmVyYXRpb24gMFxyXG5hPWNhbmRpZGF0ZTpmb3VuZGF0aW9uIDEgdWRwIDE2OTQ0OTg4MTUgNTQuMjQwLjE5Ni4xOTAgOTc5MyB0eXAgc3JmbHggcmFkZHIgMC4wLjAuMCBycG9ydCA1NDcyOCBnZW5lcmF0aW9uIDBcclxuYT1jYW5kaWRhdGU6Zm91bmRhdGlvbiAyIHVkcCAxNjk0NDk4ODE1IDU0LjI0MC4xOTYuMTkwIDk3OTMgdHlwIHNyZmx4IHJhZGRyIDAuMC4wLjAgcnBvcnQgNTQ3MjggZ2VuZXJhdGlvbiAwXHJcbmE9ZW5kLW9mLWNhbmRpZGF0ZXNcclxuIn0="
+
log.Debug("decoding")
b, err := base64.StdEncoding.DecodeString(strings.TrimSpace(offerstring))
if err != nil {
diff --git a/src/webrtc/webrtc.go b/src/webrtc/webrtc.go
index 4996869..8586d05 100644
--- a/src/webrtc/webrtc.go
+++ b/src/webrtc/webrtc.go
@@ -55,9 +55,11 @@ func createOfferer(finished chan<- error) (pc *webrtc.PeerConnection, err error)
ordered := false
maxRetransmits := uint16(0)
+ var id uint16 = 3
options := &webrtc.DataChannelInit{
Ordered: &ordered,
MaxRetransmits: &maxRetransmits,
+ ID: &id,
}
sendMoreCh := make(chan struct{})
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.