Skip to content
/ go-stun Public
forked from pixelbender/go-stun

Go implementation of STUN, TURN and ICE Protocols

License

Notifications You must be signed in to change notification settings

pexip/go-stun

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang: STUN, TURN and ICE Protocols

Build Status Coverage Status Go Report Card GoDoc

Features

  • 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
  • ...

Installation

go get github.com/pixelbender/go-stun

STUN - Server reflexive transport address lookup

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)
	}
}

TURN - Relayed transport address allocation

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())
	}
}

Specifications

About

Go implementation of STUN, TURN and ICE Protocols

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%