Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: connect EINVAL 0.0.xx.xx:80 - Local (0.0.0.0:0)

I'm trying to use hubot msg object to send http request, but finally get this error: Error: connect EINVAL 0.0.xx.xx:80 - Local (0.0.0.0:0)

A similar question is saying this is caused by hosts file, but no detail.

like image 456
alisondong Avatar asked Feb 23 '18 00:02

alisondong


1 Answers

I've been seeing this problem multiple times during the last two years. In all cases it was what @Shiva said: either the protocol or the port was missing.

Here is the most recent occurrence of this problem a co-worker had with the axios module in a Node.js application:

axios({ method: "get", url: "hostname:8080/liveness" })

After prepending http it worked:

axios({ method: "get", url: "http://hostname:8080/liveness" })

like image 117
Hedge Avatar answered Sep 18 '22 12:09

Hedge