gortc / stun

Fast RFC 5389 STUN implementation in go
BSD 3-Clause "New" or "Revised" License
494 stars 53 forks source link

client: implement basic hole punching #34

Closed ernado closed 6 years ago

ernado commented 7 years ago

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

backkem commented 6 years ago

It seems hole punching isn't really part of the STUN spec itself. The STUN Usages define actual solutions. In our case the hole punching techniques are mentioned in the ICE specs:

I wonder if we should implement this in the stun or ice package. The package boundaries are a bit blurry. E.g.: all STUN methods are also defined in the stun package while only the binding method is defined in the base STUN spec. The ice package seems more suitable in this case since it knows when to stop pinging the STUN server and switch to keep-alives between the peers. However, we could add this as an example under the cmd or examples folder.

ernado commented 6 years ago

I've created that ticket with feature parity with https://github.com/ccding/go-stun in mind.

Regarding STUN methods - they are all here to provide String() for them. We can move them to other packages, but we need some way to register them, maybe on init()

ernado commented 6 years ago

Seems like out of scope now.