{"action":"created","issue":{"url":"https://api.github.com/repos/squaremo/rabbit.js/issues/108","labels_url":"https://api.github.com/repos/squaremo/rabbit.js/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/squaremo/rabbit.js/issues/108/comments","events_url":"https://api.github.com/repos/squaremo/rabbit.js/issues/108/events","html_url":"https://github.com/squaremo/rabbit.js/issues/108","id":99910964,"number":108,"title":"[SOLVED] Cant connect to remote host","user":{"login":"evensense","id":6954397,"avatar_url":"https://avatars.githubusercontent.com/u/6954397?v=3","gravatar_id":"","url":"https://api.github.com/users/evensense","html_url":"https://github.com/evensense","followers_url":"https://api.github.com/users/evensense/followers","following_url":"https://api.github.com/users/evensense/following{/other_user}","gists_url":"https://api.github.com/users/evensense/gists{/gist_id}","starred_url":"https://api.github.com/users/evensense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evensense/subscriptions","organizations_url":"https://api.github.com/users/evensense/orgs","repos_url":"https://api.github.com/users/evensense/repos","events_url":"https://api.github.com/users/evensense/events{/privacy}","received_events_url":"https://api.github.com/users/evensense/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-09T16:21:00Z","updated_at":"2015-08-09T16:33:55Z","closed_at":null,"body":"Hello, I have RabbitMQ server running on remote machine (Ubuntu Server 14). When i try to connect to it i get error : \r\n\r\n```\r\nevents.js:85\r\n      throw er; // Unhandled 'error' event\r\n            ^\r\nError: read ECONNRESET\r\n    at exports._errnoException (util.js:746:11)\r\n    at TCP.onread (net.js:559:26)\r\n```\r\n\r\nMy code is an example one : \r\n\r\n```\r\nvar context = require('rabbit.js').createContext('amqp://tomek:root@192.168.0.11');\r\n\r\ncontext.on('ready', function() {\r\n  var pub = context.socket('PUB'), sub = context.socket('SUB');\r\n  sub.connect('events', function() {\r\n    console.log(\"Sub now listening for messages ...\");\r\n    pub.connect('events', function() {\r\n      pub.write(JSON.stringify({welcome: 'rabbit.js'}), 'utf8');\r\n    });\r\n  });\r\n  \r\n  \r\n  sub.on(\"data\", function(data) {\r\n    console.log('data : ' + data);\r\n  })\r\n});\r\n```\r\n\r\nHowever, when I dont supply remote host address ( i leave createContext() blank) everything works fine. How to deal with this error?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/squaremo/rabbit.js/issues/comments/129213611","html_url":"https://github.com/squaremo/rabbit.js/issues/108#issuecomment-129213611","issue_url":"https://api.github.com/repos/squaremo/rabbit.js/issues/108","id":129213611,"user":{"login":"evensense","id":6954397,"avatar_url":"https://avatars.githubusercontent.com/u/6954397?v=3","gravatar_id":"","url":"https://api.github.com/users/evensense","html_url":"https://github.com/evensense","followers_url":"https://api.github.com/users/evensense/followers","following_url":"https://api.github.com/users/evensense/following{/other_user}","gists_url":"https://api.github.com/users/evensense/gists{/gist_id}","starred_url":"https://api.github.com/users/evensense/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evensense/subscriptions","organizations_url":"https://api.github.com/users/evensense/orgs","repos_url":"https://api.github.com/users/evensense/repos","events_url":"https://api.github.com/users/evensense/events{/privacy}","received_events_url":"https://api.github.com/users/evensense/received_events","type":"User","site_admin":false},"created_at":"2015-08-09T16:33:55Z","updated_at":"2015-08-09T16:33:55Z","body":"It was just mistake with RabbitMQ server permissions. You can add them by running following command on server machine : \r\n\r\n```\r\nrabbitmqctl set_permissions username \".*\" \".*\" \".*\" \r\n```\r\nwhich basically gives all permissions to user, in my case **tomek**"}}