fd / go-nat

NAT port mapping library for Go
Apache License 2.0
43 stars 35 forks source link

Better handle networks with multiple NATS #9

Open Stebalien opened 5 years ago

Stebalien commented 5 years ago

This:

  1. Provides a way to iterate over all discovered NATs.
  2. Tries to pick the best one.

(also fixes possible goroutine leaks when multiple NATs are discovered)

Honestly, the best way to handle mulitple NATs would be to try to configure all of them. However, this is a simpler interim solution.