Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl: (56) Recv failure: Connection was reset

Tags:

rest

curl

I have a RESTful web service taking all 4 HTTP request methods. I am getting proper responses when I am using a rest client (Advanced Rest Client in Chrome) to send requests to this service using the ip address of the machine. My url is this http://ipaddress:8080/messenger/webapi/messages. However, when I use curl to fire the same requests I get curl: (56) Recv failure: Connection was reset. The only difference I found out in the two was that the REST client fires requests from 0.0.0.0 and the curl requests are fired from 127.0.0.1. But why should this make any difference?

The same curl command works when the app is running on the same machine from which the curl is fired. It doesn't work only when the app is running on another machine. Eg. curl http://ipaddress:8080/messenger/webapi/messages for GET request.

I tried disabling the firewall on the machine having the app with no luck.

like image 439
adarsh hegde Avatar asked Feb 07 '23 05:02

adarsh hegde


1 Answers

Check which port curl uses and whether it is blocked by the firewall or not. Also check whether the port on the app accepts requests.

like image 83
Chetan Bhagat Avatar answered Mar 11 '23 16:03

Chetan Bhagat