Popularity
6.6
Growing
Activity
4.5
Growing
390
12
74

Programming language: Go
Tags: Networking    
Latest version: v0.1.2

go-stun alternatives and similar packages

Based on the "Networking" category

Do you think we are missing an alternative of go-stun or a related project?

Add another 'Networking' Package

README

go-stun

Build Status License GoDoc Go Report Card

go-stun is a STUN (RFC 3489, 5389) client implementation in golang (a.k.a. UDP hole punching).

RFC 3489: STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)

RFC 5389: Session Traversal Utilities for NAT (STUN)

Use the Command Line Tool

Simply run these commands (if you have installed golang and set $GOPATH)

go get github.com/ccding/go-stun
go-stun

or clone this repo and run these commands

go build
./go-stun

You will get the output like

NAT Type: Full cone NAT
External IP Family: 1
External IP: 166.111.4.100
External Port: 23009

You can use -s flag to use another STUN server, and use -v to work on verbose mode.

> ./go-stun --help
Usage of ./go-stun:
  -s string
        server address (default "stun1.l.google.com:19302")
  -v    verbose mode

Use the Library

The library github.com/ccding/go-stun/stun is extremely easy to use -- just one line of code.

import "github.com/ccding/go-stun/stun"

func main() {
    nat, host, err := stun.NewClient().Discover()
}

More details please go to main.go and GoDoc


*Note that all licence references and agreements mentioned in the go-stun README section above are relevant to that project's source code only.