I have written some code using modules cheerio, request and longjohn that worked yesterday, but today it always throws the "ECONNREFUSED" error.
I tried using simple sample code that uses request:
var request = require('request');
request('http://www.google.com', function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body) // Show the HTML for the Google homepage.
}
else{
console.log(error);
}
})
Yet it still returns:
{[Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' }
Just wondering what could be the cause of this, I can connect to the internet fine using web browsers.
Thanks