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:
WofWca 2024-12-04 19:14:46 +04:00 committed by Cecylia Bocovich
parent f6767061e4
commit 94b6647d33
No known key found for this signature in database
GPG key ID: 009DE379FD9B7B90
4 changed files with 163 additions and 27 deletions

View file

@ -423,7 +423,10 @@ func TestBrokerChannel(t *testing.T) {
So(err, ShouldBeNil)
brokerChannel.SetNATType(nat.NATRestricted)
answerSdpReturned, err := brokerChannel.Negotiate(offerSdp)
answerSdpReturned, err := brokerChannel.Negotiate(
offerSdp,
brokerChannel.GetNATType(),
)
So(err, ShouldBeNil)
So(answerSdpReturned, ShouldEqual, answerSdp)