Reputation: 161
I try to make the lessons of the makemehapi workshop of nodeschool.io on nitrious.io But for some reason I Always get this error message :
✗ Error connecting to http://localhost:5548: ECONNREFUSED
Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
I tried to increase the timeout but no luck.
Anyone a idea how to make this work.
Roelof
Edit 1 :
I change this :
function verify (port, stream) {
function error (err) {
exercise.emit('fail', 'Error connecting to http://localhost:' + port + ': ' + err.code)
}
hyperquest.get('http://localhost:' + port + '/')
.on('error', error)
.pipe(bl(function (err, data) {
if (err)
return stream.emit('error', err)
stream.write(data.toString() + '\n');
stream.end();
}));
}
verify(this.submissionPort, this.submissionStdout)
if (mode == 'verify') {
verify(this.solutionPort, this.solutionStdout);
to this :
function verify (port, stream) {
function error (err) {
exercise.emit('fail', 'Error connecting to http://localhost:' + port + ': ' + err.code)
}
hyperquest.get('http://0.0.0.0' + port + '/')
.on('error', error)
.pipe(bl(function (err, data) {
if (err)
return stream.emit('error', err)
stream.write(data.toString() + '\n');
stream.end();
}));
}
verify(this.submissionPort, this.submissionStdout)
if (mode == 'verify') {
verify(this.solutionPort, this.solutionStdout);
nothing changes.
Edit 2 : I have looked at other exercises that work perfectly and some of them also work with localhost so I do not think that is a problem.
Upvotes: 1
Views: 68
Reputation: 1599
The Nitrous servers listen on 0.0.0.0, so you will want to reconfigure your host to utilize that instead of localhost. Once changed then the connection should work.
Upvotes: 1