NAT piercing udp peer to peer connections

anyone advice on how to, or seasonned networkers caring to share?

this kind of thing would suit my needs, but seems windows only?
https://www.codeproject.com/Articles/23481/Stunner-A-STUN-Library-and-Client

this is a great article
http://www.brynosaurus.com/pub/net/p2pnat/

also

can i beta test?? :slight_smile:

if you make this work for me, sure, but i don’t do betas anymore. it’s already rolling released.
ty, very nice article indeed.

I’ve used: https://github.com/arturoc/ofxNice succesfully to do NAT transversal I haven’t updated it in a while so you might need to change some things to make it compile with latest OF.

Nice uses several mechanisms to try to go through the nat router, from upnp if it’s enabled in the router, then ICE which should work for most home routers but won’t work for some big organizations or hotels routers which block this mechanism and you need to use a stun server. there’s some publicly available stun servers that you might be able to use. The included example shows how to do so.

1 Like

:star_struck:
thank you!!

your code is super nice, very well documented, and already compiling smoothly, just throw in a using namespece std somewhere,

guess now i’m having a crash because the stun server you have on setup does nbot exist anymore, anyways, working and running. :slight_smile:

Thread 1 “example” received signal SIGSEGV, Segmentation fault.
0x0000555555595dfe in ofxNiceStream::setup(ofxNiceAgent&, int) ()
(gdb) bt
#0 0x0000555555595dfe in ofxNiceStream::setup(ofxNiceAgent&, int) ()
#1 0x000055555558f223 in testApp::setup() ()
#2 0x00005555555cfd23 in std::_Function_handler<bool (void const*, ofEventArgs&), std::shared_ptr<of::priv::Function<ofEventArgs, std::recursive_mutex> > ofEvent<ofEventArgs, std::recursive_mutex>::make_function(ofBaseApp*, void (ofBaseApp::)(ofEventArgs&), int)::{lambda(void const, ofEventArgs&)#1}>::_M_invoke(std::_Any_data const&, void const*&&, ofEventArgs&) ()
#3 0x00005555556513a4 in ofCoreEvents::notifySetup() ()
#4 0x00005555555cdcd1 in ofMainLoop::run(std::shared_ptr, std::shared_ptr&&) ()
#5 0x00005555555cfc7e in ofMainLoop::run(std::shared_ptr&&) ()
#6 0x00005555555da964 in ofRunApp(ofBaseApp*) ()
#7 0x0000555555575b94 in main ()

that’s great to hear, you can configure it without stun server as well if that’s problematic, it should work with most setups