Coder Social home page Coder Social logo

gortc / stun Goto Github PK

View Code? Open in Web Editor NEW
491.0 21.0 55.0 1.77 MB

Fast RFC 5389 STUN implementation in go

License: BSD 3-Clause "New" or "Revised" License

Go 97.78% Makefile 0.73% Shell 1.32% Dockerfile 0.16%
stun webrtc golang go nat-traversal rfc-5389 stun-server gortc

stun's People

Contributors

backkem avatar dependabot[bot] avatar ernado avatar fossabot avatar moisesbr avatar muesli avatar songjiayang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stun's Issues

Command line client

CLI should print firewall type and (optionally) discovered ip address.

Like:

# stun-cli
Firewalled, Port-restricted code NAT, ip: 212.224.21.4

Handle padding

Implement padding handling for attribute values as specified in RFC.

Firefox: illegal message size

(stun/WARNING) Illegal message size: 26
(stun/WARNING) STUN-CLIENT(srflx(IP4:192.168.1.52:33549/UDP|IP4:127.0.0.1:3478/UDP)): error decoding response
(stun/WARNING) Illegal message size: 26
(stun/WARNING) STUN-CLIENT(srflx(IP4:192.168.1.52:33549/UDP|IP4:127.0.0.1:3478/UDP)): error decoding response
(stun/WARNING) Illegal message size: 26
(stun/WARNING) STUN-CLIENT(srflx(IP4:192.168.1.52:33549/UDP|IP4:127.0.0.1:3478/UDP)): error decoding response
(stun/WARNING) Illegal message size: 26
(stun/WARNING) STUN-CLIENT(srflx(IP4:192.168.1.52:33549/UDP|IP4:127.0.0.1:3478/UDP)): error decoding response

Probably padding issue.

Refactor stun.Client for hole punching

As discovered in #38 an open connection should be reused. The aim is to better support this use-case by refactoring stun.Client around a subset of the net.PacketConn interface.

client: support TCP protocol

Support the TCP protocol while communicating to server.

It seems we should wait to try this until golang/go#9661 lands in Go 1.11.

Should be implemented:

  • The "TCP" mode for RTO that disables retransmissions

Improve test coverage

Ideal test coverage for stun package is 95% or more. It is pretty easy to achieve that.

client: implement basic hole punching

Provide a way to use discovered external address to receive actual udp packets from another agent.

MVP:
client1 discover
1> ip:port

client2 ip:port

ok

1> ok from ip:port2

Status update

Quick status update:
API is stable (with exception for Client/Agent implementations in this package), so it is safe
to use it, if you only need STUN decoding/encoding. That part is blackbox and unit-tested and should
contain minimum to no bugs.

I'm currently have no time to actively develop golang webrtc stack, but that will change shortly.

client/agent: Retransmissions

When using the UDP transport packets may be dropped. The stun client SHOULD (but it seems more like a MUST with exceptions of LAN usage) implement retransmissions.
One thing to note is that the ICE spec has it's own specification for RTO. It will therefore have to be exported if we want to reuse stun.Client and/or stun.Agent in package ice.

all: add IPv6 support

Seems like we can just add needed constants, most work should be done in gortc/turn.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.