Anouar Kacem Anouar Kacem - 24 days ago 7
Node.js Question

Getting Error: connect ECONNREFUSED 127.0.0.1:80 node.js

I am trying to connect to odoo via odoo-xmlrpc

var odoo = new Odoo({
url: 'x.y.z.com',
port: 80,
db: 'Data_Base',
username: 'username',
password: 'password'
});


my debugger shows "client normal" for the second line (console.log(err)) of the code below

odoo.connect(function (err) {
if (err) { return console.log(err); }
console.log('Connected to Odoo server.');
});


and this Error for the 3rd line :

{ Error: connect ECONNREFUSED 127.0.0.1:80
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 80 }


I am using meanjs 0.5.0, this is the development configuration

port: process.env.PORT || 3000,
host: process.env.HOST || 'localhost',


I tried to use the same code on loopbackjs and it worked, but i need to deploy my app on meanjs why am I getting this error ?

Answer Source

I was using odoo-xmlrpc 1.0.5 on loopbackjs and 1.0.6 on meanjs ... When I downgraded to to 1.0.5 it worked on meanjs and to be sure about that i upgraded the package on loopback and i had the same error ...

so it is a version issue at the moment. thank you for passing by.

EDIT :

Must use http://url or https://url