ofxNice not working on different networks (ofxGstRTP example)

Hello,
I’ve set up ofxGstRTP example_video_audio example, and it worked pretty nice:

however I noticed that it works well only when both PCs are on the same network. When I tried to speak between PCs on different networks, they don’t work. I changed lots of different stun servers, but they didn’t help.

Problem seems to be with libnice.
Maybe you had this problem?
(I am planning to make a VPN server, maybe this would help)

I would appreciate if you share you experience of connecting two machines on different networks with ofxGstRTP.

Here’s output by the way:

  1. https://gist.github.com/barelief/5befb2e214c5629b464a (this is when both machines are on the same network, and streaming works perfectly)
  2. https://gist.github.com/barelief/32353043d5d9e309461f (this is when streaming is not working, and machines are on different newtorks)

As I understand ofxGstRTP should work without any special network configuration?

Yes this should work without problem among different networks. the only time i’ve found this kind of errors is when working from corporate networks, usually there’s symmetric routers in those, (hotels or other big organizations will probably have the same problem). which means that the trick stun uses to punch holes in the router won’t work. you can use TURN instead of STUN in those cases. it’s really easy to install a TURN server: https://code.google.com/p/rfc5766-turn-server/ you’ll need to install it on a server that is not behind a NAT router and it’ll relay all data. in the video_audio example there’s a commented line showing how to use it, mainly just add after setting the IP for the stun server:

rtp.addRelay(TURN_IP_ADDRESS,3479,"","",NICE_RELAY_TYPE_TURN_UDP);