I am developing a P2P App for a IOT project, I have researched the subject for months, I know C and C++ languages,(Reason why im not using webRTC or libp2p) Im trying to run Libnice simple-example.c (https://github.com/libnice/libnice/raw/master/examples/simple-example.c)
Followed included instructions on code:
- Build:
- gcc -o simple-example simple-example.c
pkg-config --cflags --libs nice
- Run two clients, one controlling and one controlled:
- simple-example 0 $(host -4 -t A stun.stunprotocol.org | awk '{ print $4 }')
- simple-example 1 $(host -4 -t A stun.stunprotocol.org | awk '{ print $4 }')
Everything seems Ok, heres the output for 0:
Copy this line to remote client:
XZin vUO/eXLznpYKc64c6h1aLE 1,2013266431,192.168.1.4,44673,host 2,1015021823,192.168.1.4,0,host 3,1010827519,192.168.1.4,54925,host
Output for 1:
Copy this line to remote client:
1bFK vq/Pfjfbx8eVXOQTd9AKl9 1,2015363327,2804:18:101e:7113:d560:d583:90f:63c9,59945,host 2,1015021823,2804:18:101e:7113:d560:d583:90f:63c9,0,host 3,1010827519,2804:18:101e:7113:d560:d583:90f:63c9,42907,host 4,2015363583,192.168.43.72,60170,host 5,1015022079,192.168.43.72,0,host 6,1010827775,192.168.43.72,48765,host 7,2015363839,fe80::2b54:598:ecc0:bc7c,41165,host 8,1015022335,fe80::2b54:598:ecc0:bc7c,0,host 9,1010828031,fe80::2b54:598:ecc0:bc7c,51801,host
I am using my home ISP for 1, and mobile internet (Not on my home Wifi) on 2, so they are not on the same network, When i copy the lines the program just crash whithout an output or error message,
Anybody knows whats going on ? (I know libp2p has C implementantion but it lacks lots of features, and the most important for me is NAT Traversal on both sides)