I am testing an API I have made using Springboot from my laptop (192.168.1.217:8080) and I am trying to get a cURL request via SSH from my Raspberry Pi.
Here is the error I am receiving when I try to send the request via port 8080 which it seems to not like:
[email protected]:~ $ curl -v 192.168.1.217:8080/api * Hostname was NOT found in DNS cache * Trying 192.168.1.217...
However cURL does work for the same IP but with port 80:
[email protected]:~ $ curl -v 192.168.1.217 * Rebuilt URL to: 192.168.1.217/ * Hostname was NOT found in DNS cache * Trying 192.168.1.217... * Connected to 192.168.1.217 (192.168.1.217) port 80 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.38.0 > Host: 192.168.1.217 > Accept: */* > < HTTP/1.1 302 Found < Date: Thu, 30 Mar 2017 17:20:43 GMT * Server Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.5.38 is not blacklisted < Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.5.38 < X-Powered-By: PHP/5.5.38 < Location: http://192.168.1.217/dashboard/ < Content-Length: 0 < Content-Type: text/html < * Connection #0 to host 192.168.1.217 left intact [email protected]:~ $
I've tried looking around but to no avail... anybody have any suggestions as to why I cannot find my own hostname in the DNS cache?
Hostname was NOT found in DNS cache is not the problem. You can clearly see on the next line, in both examples, that after saying that curl is trying to connect to
192.168.1.217. Your problem is that nothing is answering on port 8080 on that IP address (while an Apache server is answering on port 80 there).
If you're getting a long pause and then a timeout rather than a quick "Connection refused", you almost certainly need to open port 8080 in the local firewall on your server machine.