Implement NAT discovery (RFC 5780) at the client

Snowflake clients will now attempt NAT discovery using the provided STUN
servers and report their NAT type to the Snowflake broker for matching.
The three possibilities for NAT types are:
- unknown (the client was unable to determine their NAT type),
- restricted (the client has a restrictive NAT and can only be paired
with unrestricted NATs)
- unrestricted (the client can be paired with any other NAT).
This commit is contained in:
Cecylia Bocovich 2020-06-10 17:16:12 -04:00
parent 1448c3885f
commit bf924445e3
5 changed files with 296 additions and 0 deletions

1
go.mod
View file

@ -7,6 +7,7 @@ require (
github.com/golang/protobuf v1.3.1 // indirect
github.com/gorilla/websocket v1.4.1
github.com/pion/sdp/v2 v2.3.4
github.com/pion/stun v0.3.5
github.com/pion/webrtc/v2 v2.2.2
github.com/smartystreets/goconvey v1.6.4
github.com/xtaci/kcp-go/v5 v5.5.12