mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
able to break out of ConnectLoop, try separate webrtcConfigs as well
This commit is contained in:
parent
4ca0a3aa0a
commit
a71c98c0ae
6 changed files with 69 additions and 46 deletions
|
@ -115,15 +115,17 @@ func (bc *BrokerChannel) Negotiate(offer *webrtc.SessionDescription) (
|
|||
// Implements the |Tongue| interface to catch snowflakes, using BrokerChannel.
|
||||
type WebRTCDialer struct {
|
||||
*BrokerChannel
|
||||
webrtcConfig *webrtc.Configuration
|
||||
// webrtcConfig *webrtc.Configuration
|
||||
iceServers IceServerList
|
||||
}
|
||||
|
||||
func NewWebRTCDialer(
|
||||
broker *BrokerChannel, iceServers IceServerList) *WebRTCDialer {
|
||||
config := webrtc.NewConfiguration(iceServers...)
|
||||
|
||||
return &WebRTCDialer{
|
||||
BrokerChannel: broker,
|
||||
webrtcConfig: config,
|
||||
iceServers: iceServers,
|
||||
// webrtcConfig: config,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +136,8 @@ func (w WebRTCDialer) Catch() (Snowflake, error) {
|
|||
}
|
||||
// TODO: [#3] Fetch ICE server information from Broker.
|
||||
// TODO: [#18] Consider TURN servers here too.
|
||||
connection := NewWebRTCConnection(w.webrtcConfig, w.BrokerChannel)
|
||||
config := webrtc.NewConfiguration(w.iceServers...)
|
||||
connection := NewWebRTCConnection(config, w.BrokerChannel)
|
||||
err := connection.Connect()
|
||||
return connection, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue