mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
localize ptInfo and iceServers vars, separate copy-paste helpers, move some logging
to more sensible locations
This commit is contained in:
parent
b6f15a8d5c
commit
fedb124313
4 changed files with 41 additions and 38 deletions
|
@ -17,7 +17,9 @@ type WebRTCDialer struct {
|
|||
webrtcConfig *webrtc.Configuration
|
||||
}
|
||||
|
||||
func NewWebRTCDialer(broker *BrokerChannel) *WebRTCDialer {
|
||||
func NewWebRTCDialer(
|
||||
broker *BrokerChannel, iceServers IceServerList) *WebRTCDialer {
|
||||
|
||||
config := webrtc.NewConfiguration(iceServers...)
|
||||
return &WebRTCDialer{
|
||||
BrokerChannel: broker,
|
||||
|
@ -32,8 +34,7 @@ func (w WebRTCDialer) Catch() (*webRTCConn, error) {
|
|||
}
|
||||
// TODO: [#3] Fetch ICE server information from Broker.
|
||||
// TODO: [#18] Consider TURN servers here too.
|
||||
config := webrtc.NewConfiguration(iceServers...)
|
||||
connection := NewWebRTCConnection(config, w.BrokerChannel)
|
||||
connection := NewWebRTCConnection(w.webrtcConfig, w.BrokerChannel)
|
||||
err := connection.Connect()
|
||||
return connection, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue