mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Add UDP Like transport mode to snowflake
This commit is contained in:
parent
fa122efb61
commit
457c4fbf15
8 changed files with 275 additions and 5 deletions
|
@ -41,6 +41,8 @@ type webRTCConn struct {
|
|||
cancelTimeoutLoop context.CancelFunc
|
||||
|
||||
bytesLogger bytesLogger
|
||||
|
||||
protocol string
|
||||
}
|
||||
|
||||
func newWebRTCConn(pc *webrtc.PeerConnection, dc *webrtc.DataChannel, pr *io.PipeReader, bytesLogger bytesLogger) *webRTCConn {
|
||||
|
@ -137,6 +139,14 @@ func (c *webRTCConn) SetWriteDeadline(t time.Time) error {
|
|||
return fmt.Errorf("SetWriteDeadline not implemented")
|
||||
}
|
||||
|
||||
func (c *webRTCConn) SetConnectionProtocol(protocol string) {
|
||||
c.protocol = protocol
|
||||
}
|
||||
|
||||
func (c *webRTCConn) GetConnectionProtocol() string {
|
||||
return c.protocol
|
||||
}
|
||||
|
||||
func remoteIPFromSDP(str string) net.IP {
|
||||
// Look for remote IP in "a=candidate" attribute fields
|
||||
// https://tools.ietf.org/html/rfc5245#section-15.1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue