简体   繁体   中英

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.

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" })

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM