Closed ernado closed 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.
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()
Seems like out of scope now.
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
1> ok from ip:port2