mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
feat(client): try restricted proxy if NAT unknown
Just once, to offload unrestricted proxies. This is useful when our STUN servers are blocked or don't support the NAT discovery feature, or if they're just slow. Closes https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40178. Partially addresses https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40376 Signed-off-by: Cecylia Bocovich <cohosh@torproject.org>
This commit is contained in:
parent
f6767061e4
commit
94b6647d33
4 changed files with 163 additions and 27 deletions
|
@ -156,12 +156,14 @@ func NewSnowflakeClient(config ClientConfig) (*Transport, error) {
|
|||
}
|
||||
go updateNATType(iceServers, broker, config.CommunicationProxy)
|
||||
|
||||
natPolicy := &NATPolicy{}
|
||||
|
||||
max := 1
|
||||
if config.Max > max {
|
||||
max = config.Max
|
||||
}
|
||||
eventsLogger := event.NewSnowflakeEventDispatcher()
|
||||
transport := &Transport{dialer: NewWebRTCDialerWithEventsAndProxy(broker, iceServers, max, eventsLogger, config.CommunicationProxy), eventDispatcher: eventsLogger}
|
||||
transport := &Transport{dialer: NewWebRTCDialerWithNatPolicyAndEventsAndProxy(broker, natPolicy, iceServers, max, eventsLogger, config.CommunicationProxy), eventDispatcher: eventsLogger}
|
||||
|
||||
return transport, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue