ENETUNREACH error using private IP address

I’ve got a simple app that sends a random number via the http request node and when using a private address I get the ENETUNREACH error yet if I use a public web server it works fine. I use fully qualified domain name in the URL.
There is an A record on the DNS server for imp.mydomain.com mapped to 192.168.8.60 which results in the error.
Change to www.mydomain.com mapped to public IP and it works fine.
Files and web server configs are the same.
Both are accessible via laptop browser and other machines.
Is this expected behavior of the IMP?
Thanks.
-Trevor.

This is correct. The http request node isn’t in the imp, it’s in the imp server which lives in amazon ec2.

Thanks Hugo. Is there a way the Imp can communicate via http or other TCP/IP within a private network?

As a work around, I’ve put a NAT forwarding rule on the router and changed the DNS to use one of the public IP addresses.

No, the imp maintains a single encrypted tunnel to the server. It neither makes nor receives any local connections, TCP, UDP or otherwise. This makes lots of things simple, but local network communications isn’t one of them :slight_smile:

hi. i want to communitcate my server with imp002 tell me some keywords so that i can search in google

this is my first project with imp module. usually i use ip address and ports for TCP/IP communication can i use the same method in here.

@rahul123 - the imp platform takes care of communication between the device (the hardware) and the agent (the server). You use device.send/agent.on and agent.send/device.on.

The agent can send HTTP web requests using http.get, http.put, http.post, http.httpdelete, and http.request.

The agent can process incoming HTTP requests (i.e. you can write a simple HTTP server) using http.onrequest.

So all the communication between the device and the server is taken care of for you, and all the communication between the imp and the Internet is done through HTTP requests (both inbound and out).