Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connects to 127.0.0.1 #1

Open
pvijaysimha opened this issue Feb 26, 2018 · 3 comments
Open

Connects to 127.0.0.1 #1

pvijaysimha opened this issue Feb 26, 2018 · 3 comments

Comments

@pvijaysimha
Copy link

It seems, the client always connects to local IP. Not sure where I went wrong?

myserverip is Java socket server IP

const Synket = require('synket');

try{
var connection = new Synket({url: 'myserverip', port: 9811});

var result = connection.send('command-to-get-somedata');

console.log(result);

}catch(err){
console.log(err);
}

Error: connect ECONNREFUSED 127.0.0.1:9811
at Object.exports._errnoException (util.js:1029:11)
at exports._exceptionWithHostPort (util.js:1052:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:14)

at Object.send (/home/vijay/Work/RSS/backofficenode/node_modules/synket/src/Synket.js:22:10)
at Object.<anonymous> (/home/vijay/Work/RSS/backofficenode/services/util/socketService.js:7:29)
@devarajchidambaram
Copy link

devarajchidambaram commented Mar 13, 2018

Yes Im too facing the same error ..Its connects always to local ip

@devarajchidambaram
Copy link

Need to update in docs instead of url use host, it will work fine

var connection = new Synket({url: 'http://example.org', port: 4564});

var connection = new Synket({host: 'http://example.org', port: 4564});

@devarajchidambaram
Copy link

I sent the merge request please update the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants