ccding / go-stun

A go implementation of the STUN client (RFC 3489 and RFC 5389)
Apache License 2.0
675 stars 120 forks source link

Reuse the same connection for requests (fixes #5) #6

Closed AudriusButkevicius closed 8 years ago

AudriusButkevicius commented 8 years ago

Verified that this fixes my issue where my NAT was identified as Symetric NAT, though in reality it was a Full Cone (verified by pystun and C# client)

It seems that using net.Dial multiple times uses a different local port every time, which as a result causes Stun servers to ignore 2nd request/test.

Also makes it easier to print the type, and allows passing our own connection.

xiang90 commented 8 years ago

lgtm

AudriusButkevicius commented 8 years ago

There still seems to be another issue somewhere, when testing on a machine with a public IP, I am still getting a Symmetric NAT report, though pystun reports Full Cone (which is also a lie I'd say)