mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Separate peers.go file with improved documentation and more solid interfaces
This commit is contained in:
parent
556596cc5a
commit
c63f5cfc0a
5 changed files with 186 additions and 120 deletions
|
@ -14,6 +14,14 @@ import (
|
|||
// Implements the |Tongue| interface to catch snowflakes, using a BrokerChannel.
|
||||
type WebRTCDialer struct {
|
||||
*BrokerChannel
|
||||
webrtcConfig *webrtc.Configuration
|
||||
}
|
||||
|
||||
func NewWebRTCDialer(broker *BrokerChannel) *WebRTCDialer {
|
||||
return &WebRTCDialer{
|
||||
broker,
|
||||
webrtc.NewConfiguration(iceServers...),
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize a WebRTC Connection by signaling through the broker.
|
||||
|
@ -33,7 +41,7 @@ func (w WebRTCDialer) Catch() (*webRTCConn, error) {
|
|||
type webRTCConn struct {
|
||||
config *webrtc.Configuration
|
||||
pc *webrtc.PeerConnection
|
||||
snowflake SnowflakeChannel // Holds the WebRTC DataChannel.
|
||||
snowflake SnowflakeDataChannel // Holds the WebRTC DataChannel.
|
||||
broker *BrokerChannel
|
||||
|
||||
offerChannel chan *webrtc.SessionDescription
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue