Skip to content

Instantly share code, notes, and snippets.

@Sean-Der
Created April 11, 2019 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sean-Der/9c4c2d286cf040cc2ff61277a18490bd to your computer and use it in GitHub Desktop.
Save Sean-Der/9c4c2d286cf040cc2ff61277a18490bd to your computer and use it in GitHub Desktop.
diff --git a/README.md b/README.md
index 9868096..2b95e8f 100644
--- a/README.md
+++ b/README.md
@@ -7,18 +7,18 @@
<p align="center">
<a href="https://pion.ly"><img src="https://img.shields.io/badge/pion-ice-gray.svg?longCache=true&colorB=brightgreen" alt="Pion transport"></a>
<a href="http://gophers.slack.com/messages/pion"><img src="https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen" alt="Slack Widget"></a>
- <a href="https://waffle.io/pions/webrtc"><img src="https://img.shields.io/badge/pm-waffle-gray.svg?longCache=true&colorB=brightgreen" alt="Waffle board"></a>
+ <a href="https://waffle.io/pion/webrtc"><img src="https://img.shields.io/badge/pm-waffle-gray.svg?longCache=true&colorB=brightgreen" alt="Waffle board"></a>
<br>
- <a href="https://travis-ci.org/pions/ice"><img src="https://travis-ci.org/pions/ice.svg?branch=master" alt="Build Status"></a>
- <a href="https://godoc.org/github.com/pions/ice"><img src="https://godoc.org/github.com/pions/ice?status.svg" alt="GoDoc"></a>
- <a href="https://coveralls.io/github/pions/ice"><img src="https://coveralls.io/repos/github/pions/ice/badge.svg" alt="Coverage Status"></a>
- <a href="https://goreportcard.com/report/github.com/pions/ice"><img src="https://goreportcard.com/badge/github.com/pions/ice" alt="Go Report Card"></a>
+ <a href="https://travis-ci.org/pion/ice"><img src="https://travis-ci.org/pion/ice.svg?branch=master" alt="Build Status"></a>
+ <a href="https://godoc.org/github.com/pion/ice"><img src="https://godoc.org/github.com/pion/ice?status.svg" alt="GoDoc"></a>
+ <a href="https://coveralls.io/github/pion/ice"><img src="https://coveralls.io/repos/github/pion/ice/badge.svg" alt="Coverage Status"></a>
+ <a href="https://goreportcard.com/report/github.com/pion/ice"><img src="https://goreportcard.com/badge/github.com/pion/ice" alt="Go Report Card"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
</p>
<br>
### Roadmap
-The library is used as a part of our WebRTC implementation. Please refer to that [roadmap](https://github.com/pions/webrtc/issues/9) to track our major milestones.
+The library is used as a part of our WebRTC implementation. Please refer to that [roadmap](https://github.com/pion/webrtc/issues/9) to track our major milestones.
### Community
Pion has an active community on the [Golang Slack](https://invite.slack.golangbridge.org/). Sign up and join the **#pion** channel for discussions and support. You can also use [Pion mailing list](https://groups.google.com/forum/#!forum/pion).
@@ -28,7 +28,7 @@ We are always looking to support **your projects**. Please reach out if you have
If you need commercial support or don't want to use public methods you can contact us at [team@pion.ly](mailto:team@pion.ly)
### Contributing
-Check out the **[contributing wiki](https://github.com/pions/webrtc/wiki/Contributing)** to join the group of amazing people making this project possible:
+Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contributing)** to join the group of amazing people making this project possible:
* [John Bradley](https://github.com/kc5nra) - *Original Author*
* [Sean DuBois](https://github.com/Sean-Der) - *Original Author*
diff --git a/agent.go b/agent.go
index cbe98a1..d1d2f32 100644
--- a/agent.go
+++ b/agent.go
@@ -12,9 +12,9 @@ import (
"errors"
- "github.com/pions/logging"
- "github.com/pions/stun"
- "github.com/pions/transport/packetio"
+ "github.com/pion/logging"
+ "github.com/pion/stun"
+ "github.com/pion/transport/packetio"
)
const (
diff --git a/agent_test.go b/agent_test.go
index 0ec4718..37de743 100644
--- a/agent_test.go
+++ b/agent_test.go
@@ -5,7 +5,7 @@ import (
"testing"
"time"
- "github.com/pions/transport/test"
+ "github.com/pion/transport/test"
)
func TestPairSearch(t *testing.T) {
diff --git a/candidate.go b/candidate.go
index 766ab69..8f0cc4c 100644
--- a/candidate.go
+++ b/candidate.go
@@ -6,7 +6,7 @@ import (
"sync"
"time"
- "github.com/pions/stun"
+ "github.com/pion/stun"
)
const (
diff --git a/candidatepair.go b/candidatepair.go
index 3eba1d8..8a717f0 100644
--- a/candidatepair.go
+++ b/candidatepair.go
@@ -3,7 +3,7 @@ package ice
import (
"fmt"
- "github.com/pions/stun"
+ "github.com/pion/stun"
)
func newCandidatePair(local, remote *Candidate, controlling bool) *candidatePair {
diff --git a/go.mod b/go.mod
index f11d1c5..22dd5af 100644
--- a/go.mod
+++ b/go.mod
@@ -1,11 +1,10 @@
-module github.com/pions/ice
+module github.com/pion/ice
go 1.12
require (
- github.com/pions/logging v0.2.0
- github.com/pions/stun v0.2.0
- github.com/pions/transport v0.5.0
- github.com/pions/webrtc v1.2.0
+ github.com/pion/logging v0.2.1
+ github.com/pion/stun v0.2.1
+ github.com/pion/transport v0.6.0
github.com/stretchr/testify v1.3.0
)
diff --git a/go.sum b/go.sum
index ef1c0ae..b080857 100644
--- a/go.sum
+++ b/go.sum
@@ -1,24 +1,15 @@
+github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
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/pions/dtls v1.0.2/go.mod h1:T22vu8VCOxNmIrbe3nnM1UdIo3m1Bx5CJNkHyehahLg=
-github.com/pions/logging v0.2.0 h1:xSCkE+7+aebgVimtHBv7Y8b8waT8pgeyKku9Bo+eGdk=
-github.com/pions/logging v0.2.0/go.mod h1:duuz9/Se8ujqvq7OPzbnPpRlha6A0fk1Ba2wrbn4zew=
-github.com/pions/pkg v0.0.0-20181115215726-b60cd756f712/go.mod h1:r9wKZs+Xxv2acLspex4CHQiIhFjGK1zGP+nUm/8klXA=
-github.com/pions/stun v0.2.0 h1:spIzpfkEg6HV+2iIo6qeOsAjtadZKzbXbrd2e9ZCCcs=
-github.com/pions/stun v0.2.0/go.mod h1:rMdCIsqqnTLC4MOHJE3LNiFQRfIjUDzI1kzx//7oPOM=
-github.com/pions/transport v0.5.0 h1:/KGBCzjc8bvVh8P5NP8GiSGL/PbupzhqvEOEBSlZux0=
-github.com/pions/transport v0.5.0/go.mod h1:9gvUd8ZeyU4ZX7dhNuUq97mPoekopkd7eCJEyhKwVO0=
-github.com/pions/webrtc v1.2.0 h1:U/UYMmhlVF9c1S2cfYZhR+frL0daetdP6yQnWOQzhJo=
-github.com/pions/webrtc v1.2.0/go.mod h1:bih1dMY7qksVxZTG2XMjIA6J7D5b92+MJzXYe+G2kng=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pion/logging v0.2.1 h1:LwASkBKZ+2ysGJ+jLv1E/9H1ge0k1nTfi1X+5zirkDk=
+github.com/pion/logging v0.2.1/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
+github.com/pion/stun v0.2.1 h1:rSKJ0ynYkRalRD8BifmkaGLeepCFuGTwG6FxPsrPK8o=
+github.com/pion/stun v0.2.1/go.mod h1:TChCNKgwnFiFG/c9K+zqEdd6pO6tlODb9yN1W/zVfsE=
+github.com/pion/transport v0.6.0 h1:WAoyJg/6OI8dhCVFl/0JHTMd1iu2iHgGUXevptMtJ3U=
+github.com/pion/transport v0.6.0/go.mod h1:iWZ07doqOosSLMhZ+FXUTq+TamDoXSllxpbGcfkCmbE=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
diff --git a/transport.go b/transport.go
index a0c529a..15cea1f 100644
--- a/transport.go
+++ b/transport.go
@@ -6,7 +6,7 @@ import (
"net"
"time"
- "github.com/pions/stun"
+ "github.com/pion/stun"
)
// Dial connects to the remote agent, acting as the controlling ice agent.
diff --git a/transport_test.go b/transport_test.go
index a66ab5a..8b7a2fc 100644
--- a/transport_test.go
+++ b/transport_test.go
@@ -5,7 +5,7 @@ import (
"testing"
"time"
- "github.com/pions/transport/test"
+ "github.com/pion/transport/test"
)
func TestStressDuplex(t *testing.T) {
diff --git a/url.go b/url.go
index 6f0196e..872c556 100644
--- a/url.go
+++ b/url.go
@@ -4,8 +4,6 @@ import (
"net"
"net/url"
"strconv"
-
- "github.com/pions/webrtc/pkg/rtcerr"
)
// TODO: Migrate address parsing to STUN/TURN
@@ -113,13 +111,13 @@ type URL struct {
func ParseURL(raw string) (*URL, error) {
rawParts, err := url.Parse(raw)
if err != nil {
- return nil, &rtcerr.UnknownError{Err: err}
+ return nil, err
}
var u URL
u.Scheme = NewSchemeType(rawParts.Scheme)
if u.Scheme == SchemeType(Unknown) {
- return nil, &rtcerr.SyntaxError{Err: ErrSchemeType}
+ return nil, ErrSchemeType
}
var rawPort string
@@ -143,28 +141,28 @@ func ParseURL(raw string) (*URL, error) {
}
}
}
- return nil, &rtcerr.UnknownError{Err: err}
+ return nil, err
}
if u.Host == "" {
- return nil, &rtcerr.SyntaxError{Err: ErrHost}
+ return nil, ErrHost
}
if u.Port, err = strconv.Atoi(rawPort); err != nil {
- return nil, &rtcerr.SyntaxError{Err: ErrPort}
+ return nil, ErrPort
}
switch {
case u.Scheme == SchemeTypeSTUN:
qArgs, err := url.ParseQuery(rawParts.RawQuery)
if err != nil || (err == nil && len(qArgs) > 0) {
- return nil, &rtcerr.SyntaxError{Err: ErrSTUNQuery}
+ return nil, ErrSTUNQuery
}
u.Proto = ProtoTypeUDP
case u.Scheme == SchemeTypeSTUNS:
qArgs, err := url.ParseQuery(rawParts.RawQuery)
if err != nil || (err == nil && len(qArgs) > 0) {
- return nil, &rtcerr.SyntaxError{Err: ErrSTUNQuery}
+ return nil, ErrSTUNQuery
}
u.Proto = ProtoTypeTCP
case u.Scheme == SchemeTypeTURN:
@@ -195,19 +193,19 @@ func ParseURL(raw string) (*URL, error) {
func parseProto(raw string) (ProtoType, error) {
qArgs, err := url.ParseQuery(raw)
if err != nil || len(qArgs) > 1 {
- return ProtoType(Unknown), &rtcerr.SyntaxError{Err: ErrInvalidQuery}
+ return ProtoType(Unknown), ErrInvalidQuery
}
var proto ProtoType
if rawProto := qArgs.Get("transport"); rawProto != "" {
if proto = NewProtoType(rawProto); proto == ProtoType(0) {
- return ProtoType(Unknown), &rtcerr.NotSupportedError{Err: ErrProtoType}
+ return ProtoType(Unknown), ErrProtoType
}
return proto, nil
}
if len(qArgs) > 0 {
- return ProtoType(Unknown), &rtcerr.SyntaxError{Err: ErrInvalidQuery}
+ return ProtoType(Unknown), ErrInvalidQuery
}
return proto, nil
diff --git a/url_test.go b/url_test.go
index 2c15673..accffd5 100644
--- a/url_test.go
+++ b/url_test.go
@@ -4,7 +4,6 @@ import (
"errors"
"testing"
- "github.com/pions/webrtc/pkg/rtcerr"
"github.com/stretchr/testify/assert"
)
@@ -49,19 +48,19 @@ func TestParseURL(t *testing.T) {
rawURL string
expectedErr error
}{
- {"", &rtcerr.SyntaxError{Err: ErrSchemeType}},
- {":::", &rtcerr.UnknownError{Err: errors.New("parse :::: missing protocol scheme")}},
- {"stun:[::1]:123:", &rtcerr.UnknownError{Err: errors.New("address [::1]:123:: too many colons in address")}},
- {"stun:[::1]:123a", &rtcerr.SyntaxError{Err: ErrPort}},
- {"google.de", &rtcerr.SyntaxError{Err: ErrSchemeType}},
- {"stun:", &rtcerr.SyntaxError{Err: ErrHost}},
- {"stun:google.de:abc", &rtcerr.SyntaxError{Err: ErrPort}},
- {"stun:google.de?transport=udp", &rtcerr.SyntaxError{Err: ErrSTUNQuery}},
- {"stuns:google.de?transport=udp", &rtcerr.SyntaxError{Err: ErrSTUNQuery}},
- {"turn:google.de?trans=udp", &rtcerr.SyntaxError{Err: ErrInvalidQuery}},
- {"turns:google.de?trans=udp", &rtcerr.SyntaxError{Err: ErrInvalidQuery}},
- {"turns:google.de?transport=udp&another=1", &rtcerr.SyntaxError{Err: ErrInvalidQuery}},
- {"turn:google.de?transport=ip", &rtcerr.NotSupportedError{Err: ErrProtoType}},
+ {"", ErrSchemeType},
+ {":::", errors.New("parse :::: missing protocol scheme")},
+ {"stun:[::1]:123:", errors.New("address [::1]:123:: too many colons in address")},
+ {"stun:[::1]:123a", ErrPort},
+ {"google.de", ErrSchemeType},
+ {"stun:", ErrHost},
+ {"stun:google.de:abc", ErrPort},
+ {"stun:google.de?transport=udp", ErrSTUNQuery},
+ {"stuns:google.de?transport=udp", ErrSTUNQuery},
+ {"turn:google.de?trans=udp", ErrInvalidQuery},
+ {"turns:google.de?trans=udp", ErrInvalidQuery},
+ {"turns:google.de?transport=udp&another=1", ErrInvalidQuery},
+ {"turn:google.de?transport=ip", ErrProtoType},
}
for i, testCase := range testCases {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment