Skip to content

Commit

Permalink
minor modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
enobufs committed Sep 15, 2019
1 parent 135789f commit d39241c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $ go build
$ ./go-nats -h
Usage of ./go-nats:
-s string
STUN server address. (defaults to "stun.ekiga.net:3478" (default "stun.ekiga.net:3478")
STUN server address. (default "stun.ekiga.net:3478")
-v Verbose
```

Expand All @@ -24,6 +24,8 @@ $ ./go-nats -s stun.sipgate.net
}
```

> Depending on the type of NAT, it may take ~8 seconds.
## Public STUN servers
STUN servers to use must support RFC 5780 (NAT Behavior Discovery Using STUN).
Here's a list of public STUN servers that worked with go-nats as of Sep. 13, 2019.
Expand All @@ -34,6 +36,8 @@ Here's a list of public STUN servers that worked with go-nats as of Sep. 13, 201
* stun.sipgate.net
* stun.sipgate.net:10000
* stun.1-voip.com
* stun.12connect.com
* stun.1und1.de
* stun.3clogic.com

> TODO: there may be more from this list:
* [Emercoin/ENUMER projects](http://olegh.ftp.sh/public-stun.txt)
> TODO: there may be more from this list: [Emercoin/ENUMER projects](http://olegh.ftp.sh/public-stun.txt)
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module github.com/enobufs/go-nats
go 1.12

require (
github.com/kr/pretty v0.1.0 // indirect
github.com/pion/logging v0.2.2
github.com/pion/stun v0.3.2
github.com/pion/transport v0.8.8
github.com/pion/turn v1.3.5
github.com/stretchr/testify v1.4.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pion/logging v0.2.1/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
Expand All @@ -25,5 +30,7 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func check(err error) {
}

func main() {
server := flag.String("s", "stun.ekiga.net:3478", "STUN server address. (defaults to \"stun.ekiga.net:3478\"")
server := flag.String("s", "stun.ekiga.net:3478", "STUN server address.")
verbose := flag.Bool("v", false, "Verbose")

flag.Parse()
Expand Down
3 changes: 3 additions & 0 deletions nats/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ func (nats *NATS) Discover() (*DiscoverResult, error) {

// Run filtering behavior disocvery in parallel
filterDiscovDone, err := nats.discoverFilteringBehavior()
if err != nil {
return nil, err
}

// Mapping behavior desicovery

Expand Down
1 change: 0 additions & 1 deletion nats/discover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
type virtualNet struct {
wan *vnet.Router
net0 *vnet.Net
net1 *vnet.Net
server *STUNServer
}

Expand Down

0 comments on commit d39241c

Please sign in to comment.