mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Set max number of snowflakes in the Tongue
This commit is contained in:
parent
1364d7d45b
commit
cc55481faf
6 changed files with 52 additions and 32 deletions
|
@ -155,15 +155,18 @@ func (bc *BrokerChannel) SetNATType(NATType string) {
|
|||
type WebRTCDialer struct {
|
||||
*BrokerChannel
|
||||
webrtcConfig *webrtc.Configuration
|
||||
max int
|
||||
}
|
||||
|
||||
func NewWebRTCDialer(broker *BrokerChannel, iceServers []webrtc.ICEServer) *WebRTCDialer {
|
||||
func NewWebRTCDialer(broker *BrokerChannel, iceServers []webrtc.ICEServer, max int) *WebRTCDialer {
|
||||
config := webrtc.Configuration{
|
||||
ICEServers: iceServers,
|
||||
}
|
||||
|
||||
return &WebRTCDialer{
|
||||
BrokerChannel: broker,
|
||||
webrtcConfig: &config,
|
||||
max: max,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,3 +176,8 @@ func (w WebRTCDialer) Catch() (*WebRTCPeer, error) {
|
|||
// TODO: [#25596] Consider TURN servers here too.
|
||||
return NewWebRTCPeer(w.webrtcConfig, w.BrokerChannel)
|
||||
}
|
||||
|
||||
// Returns the maximum number of snowflakes to collect
|
||||
func (w WebRTCDialer) GetMax() int {
|
||||
return w.max
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue