mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
use protocol field encoder
This commit is contained in:
parent
fb57ad79f5
commit
00da3c95ed
3 changed files with 12 additions and 7 deletions
|
@ -4,7 +4,7 @@ import (
|
|||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/messages"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
|
@ -318,7 +318,12 @@ func (c *WebRTCPeer) preparePeerConnection(
|
|||
}
|
||||
ordered := false
|
||||
var maxRetransmission uint16 = 0
|
||||
protocol := fmt.Sprintf("%s", c.clientID.String())
|
||||
connectionMetadata := messages.ClientConnectionMetadata{ClientID: c.clientID[:]}
|
||||
encodedMetadata, err := connectionMetadata.EncodeConnectionMetadata()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
protocol := encodedMetadata
|
||||
dataChannelOptions := &webrtc.DataChannelInit{
|
||||
Ordered: &ordered,
|
||||
Protocol: &protocol,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue