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

[SOLVED] Cant connect to remote host #108

Open
evensense opened this issue Aug 9, 2015 · 1 comment
Open

[SOLVED] Cant connect to remote host #108

evensense opened this issue Aug 9, 2015 · 1 comment

Comments

@evensense
Copy link

Hello, I have RabbitMQ server running on remote machine (Ubuntu Server 14). When i try to connect to it i get error :

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: read ECONNRESET
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:559:26)

My code is an example one :

var context = require('rabbit.js').createContext('amqp://tomek:[email protected]');

context.on('ready', function() {
  var pub = context.socket('PUB'), sub = context.socket('SUB');
  sub.connect('events', function() {
    console.log("Sub now listening for messages ...");
    pub.connect('events', function() {
      pub.write(JSON.stringify({welcome: 'rabbit.js'}), 'utf8');
    });
  });


  sub.on("data", function(data) {
    console.log('data : ' + data);
  })
});

However, when I dont supply remote host address ( i leave createContext() blank) everything works fine. How to deal with this error?

@evensense evensense changed the title Connection to remote host Cant connect to remote host Aug 9, 2015
@evensense evensense changed the title Cant connect to remote host [SOLVED] Cant connect to remote host Aug 9, 2015
@evensense
Copy link
Author

It was just mistake with RabbitMQ server permissions. You can add them by running following command on server machine :

rabbitmqctl set_permissions username ".*" ".*" ".*" 

which basically gives all permissions to user, in my case tomek

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

1 participant