Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curl : connection refused

Tags:

I got the following error while running curl:

curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused.

It seems that it is easy to debug, but, I didnt find how to solve it. The adress 127.0.0.1 is mentioned in the file etc/hosts.

I am using curl version 7.47 on Ubuntu system.

Anyone has an idea about it ?

Thank you.

like image 633
Amelie Avatar asked Dec 07 '16 21:12

Amelie


2 Answers

Make sure you have a service started and listening on the port.

netstat -ln | grep 8080

and

sudo netstat -tulpn
like image 132
Peter Avatar answered Sep 18 '22 14:09

Peter


Try curl -v http://localhost:8080/ instead of 127.0.0.1

like image 27
Sudharasan D Avatar answered Sep 20 '22 14:09

Sudharasan D