No network possible aside from the local network

Hi, I am having problems with creating programs that are able to connect through the internet. I am unable to connect my programs through the internet, even the example programs from OFx.

For example the OSC oscSenderExample and oscReceiveExample. They work fine as long as I have the HOST IP as localhost or 127.0.0.1 but as soon as a change it to my own IP address, nothing gets through. Same goes for the UDP examples.

Can someone help me, it’s probably something stupid I fail to see but it’s really bugging me.

it might be that you have some kind of firewall running in the computer? in windows it’s usually enbaled by default and will block any connections, not sure how to disable it though

Windows gives a warning when I start the program, but I allow it to send and receive. I also shut down my firewall just to be sure, but still nothing gets through.

It should work when I change the target IP from localhost to another IP and that program listens on the same port right?

Any one else has similar problems? I tried it with 3 different computer with 3 different IP addresses but nothing seems to get through.

I tried testing the same programs on a linux mint device (using wine). The results were the same. Nothing gets through.

What IP address are you using ? Seems like you are using an external IP

My IPv4 address is believe. Forgive me, I am a bit new to this. The IP i receive when I use: http://whatismyipaddress.com/

that won’t work, that’s the external ip of your router not the ip of your computer. if you are in windows you can get the ip of the computer running ifconfig on a console

I knew I did something stupid. When i use ipconfig in the command prompt I get a 192.168.178.x IP, but how do I send to other computer that aren’t in my local network?

*computers

you need to open the corresponding ports in your router and redirect them to the internal ip of the computer. osc uses udp so you’ll need to specify that it’s for the udp protocol not tcp

there’s libraries that allow to auto open the ports in the router but it’s not trivial and it doesn’t always work

you need to redirect ports in your target router to reach the local ip of your machine from the wide area network ip address

This got complicated quickly. Thank you guys for helping me. I will look for a way to open the ports in the target routers. My program uses the ofxUDPManager and my firewall identifies it as a UDP protocol so I guess that’s already done.

Any libraries you can advise me?

this is a low level network issue, not an aopenFrameworks issue. You need to open the port on the target router to succeed.

Alright, it works with my router gates open. But there must be a easy way around this right? Listen servers for games and programs like Skype or team viewer do it all the time.

there’s some tricks to open a port, “punch a hole” in a NAT router. the most common is to use ICE and a STUN server.

uses libnice which allows to do that but it’s pretty temperamental and it won’t work with some routers. then you can also set up a TURN server which will reroute all your traffic if the STUN server fails to open the router ports.

using upnp is also a possibility, it’s a protocol to tell a NAT router to open a port from an application but most routers come with it disabled by default for security reasons. libnice/ofxNice internally can also do upnp.

in any case it’s kind of complex to setup so unless it’s for an application you plan to distribute to non technical people or something where you need to install the application in a lot of different networks or don’t have access to the router config it’s usually easier to just open the corresponding ports in the routers.

Thank you very much for the help! I am afraid i want to use it as demo software on many different occasions with non technical people using and installing it. Its a lot more complex than i originally intended but I am not going to quit with out a try. Thank you very much Arturo and Gallo!

also if your application is not going to generate a lot of traffic another possibility is to create a small app in a server that works as a kind of proxy between the peers