- STUN Message Encoder/Decoder
- STUN Client/Server
- STUN Authorization
- STUN Redirect
- STUN Service Discovery
- ICE STUN Attributes
- ICE STUN Errors
- ICE Candidates gathering
- ICE Lite
- ICE SDP Attributes
- TURN STUN Attributes
- TURN STUN Errors
- TURN Client
- TURN Server
- ...
go get github.com/pixelbender/go-stun
package main
import (
"github.com/pixelbender/go-stun/stun"
"fmt"
)
func main() {
addr, err := stun.Lookup("stun:stun.l.google.com:19302", "username", "password")
if err != nil {
fmt.Println(err)
} else {
fmt.Println(addr)
}
}
package main
import (
"github.com/pixelbender/go-stun/turn"
"fmt"
)
func main() {
conn, err := turn.Allocate("turn:example.org", "username", "password")
if err != nil {
fmt.Println(err)
} else {
defer conn.Close()
fmt.Println(conn.RelayedAddr())
}
}