Skip to content
RFC 5766 TURN implementation in go
Branch: master
Clone or download
ernado Change ChnnelNumber type (#19)
Change ChnnelNumber type
Latest commit b392e75 Jun 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fuzz fuzz: use "fuzz" dir Aug 1, 2018
testdata chandata: fix header encoding Aug 12, 2018
.codecov.yml ci: increase coverage target to 90% Dec 1, 2018
.gitignore all: fix fuzz and update gitignore May 24, 2019
.golangci.yml all: total refactor May 24, 2019
.travis.yml ci: enable go modules May 24, 2019
LICENSE license: change to MIT May 24, 2019
Makefile ci: fix makefile test May 24, 2019
README.md all: update readme May 24, 2019
addr.go addr: add EqualIP May 16, 2019
addr_test.go addr: add EqualIP May 16, 2019
appveyor.yml ci: update May 24, 2019
chandata.go lint: fix warnings Aug 12, 2018
chandata_test.go all: use pion/stun and remove client May 24, 2019
chann.go Change ChnnelNumber type Jun 17, 2019
chann_test.go all: use pion/stun and remove client May 24, 2019
chrome_test.go all: use pion/stun and remove client May 24, 2019
data.go all: use pion/stun and remove client May 24, 2019
data_test.go all: use pion/stun and remove client May 24, 2019
dontfrag.go all: use pion/stun and remove client May 24, 2019
dontfrag_test.go all: use pion/stun and remove client May 24, 2019
evenport.go all: use pion/stun and remove client May 24, 2019
evenport_test.go all: use pion/stun and remove client May 24, 2019
fuzz.go all: fix fuzz and update gitignore May 24, 2019
fuzz_test.go fuzz: use "fuzz" dir Aug 1, 2018
go.mod Bump pion/stun Jun 3, 2019
go.sum Bump pion/stun Jun 3, 2019
go.test.sh all: use stun.{CheckSize,IsAttrSizeInvalid} Aug 1, 2018
lifetime.go all: use pion/stun and remove client May 24, 2019
lifetime_test.go all: use pion/stun and remove client May 24, 2019
peeraddr.go attrs: add type aliases for XOR-{PEER,RELAYED}-ADDR Jun 3, 2019
peeraddr_test.go all: use pion/stun and remove client May 24, 2019
relayedaddr.go attrs: add type aliases for XOR-{PEER,RELAYED}-ADDR Jun 3, 2019
relayedaddr_test.go all: use pion/stun and remove client May 24, 2019
reqfamily.go all: use pion/stun and remove client May 24, 2019
reqfamily_test.go all: use pion/stun and remove client May 24, 2019
reqtrans.go all: use pion/stun and remove client May 24, 2019
reqtrans_test.go all: use pion/stun and remove client May 24, 2019
rsrvtoken.go all: use pion/stun and remove client May 24, 2019
rsrvtoken_test.go all: use pion/stun and remove client May 24, 2019
turn.go all: use pion/stun and remove client May 24, 2019
turn_test.go all: use stun.{CheckSize,IsAttrSizeInvalid} Aug 1, 2018
uri.go uri: implement RFC 7065 Aug 17, 2018
uri_test.go uri: fix TestParseURI Aug 18, 2018

README.md

Build Status Master status Build status GoDoc codecov Go Report stability-beta FOSSA Status

TURN

Package turn implements TURN [RFC5766] Traversal Using Relays around NAT. Based on pion/stun package. See gortcd for TURN server and stunc for TURN client.

Supported RFCs

  • RFC 5766 — Traversal Using Relays around NAT
    • UDP transport for client
    • TCP or TLS transport for client
  • RFC 6156 — TURN Extension for IPv6
  • RFC 7065 — TURN URI
  • RFC 5928 — TURN Resolution Mechanism #13
  • RFC 6062 — TURN Extension for TCP Allocations #14

Testing

Client behavior is tested and verified in many ways:

  • End-To-End with long-term credentials
    • coturn: The coturn server (linux)
    • gortcd: The gortcd server (windows)
  • Bunch of code static checkers (linters)
  • Unit-tests (linux {amd64, arm64}, windows}
  • Explicit API backward compatibility check, see api directory (relaxed until v1)

See TeamCity project and e2e directory for more information. Also the Wireshark .pcap files are available for some of e2e tests in artifacts for build.

Benchmarks

goos: linux
goarch: amd64
pkg: github.com/gortc/turn
PASS
benchmark                                 iter     time/iter     throughput   bytes alloc        allocs
---------                                 ----     ---------     ----------   -----------        ------
BenchmarkIsChannelData-12           2000000000    1.64 ns/op   6694.29 MB/s        0 B/op   0 allocs/op
BenchmarkChannelData_Encode-12       200000000    9.11 ns/op   1317.35 MB/s        0 B/op   0 allocs/op
BenchmarkChannelData_Decode-12       500000000    3.92 ns/op   3061.45 MB/s        0 B/op   0 allocs/op
BenchmarkChannelNumber/AddTo-12      100000000   12.60 ns/op                       0 B/op   0 allocs/op
BenchmarkChannelNumber/GetFrom-12    200000000    7.23 ns/op                       0 B/op   0 allocs/op
BenchmarkData/AddTo-12               100000000   18.80 ns/op                       0 B/op   0 allocs/op
BenchmarkData/AddToRaw-12            100000000   16.80 ns/op                       0 B/op   0 allocs/op
BenchmarkLifetime/AddTo-12           100000000   13.70 ns/op                       0 B/op   0 allocs/op
BenchmarkLifetime/GetFrom-12         200000000    7.10 ns/op                       0 B/op   0 allocs/op
ok  	github.com/gortc/turn	19.110s
You can’t perform that action at this time.