{"action":"created","issue":{"url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/329","repository_url":"https://api.github.com/repos/SOHU-Co/kafka-node","labels_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/329/comments","events_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/329/events","html_url":"https://github.com/SOHU-Co/kafka-node/issues/329","id":133354662,"number":329,"title":"Always Connects to localhost","user":{"login":"tjmcclure0501","id":10501891,"avatar_url":"https://avatars.githubusercontent.com/u/10501891?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcclure0501","html_url":"https://github.com/tjmcclure0501","followers_url":"https://api.github.com/users/tjmcclure0501/followers","following_url":"https://api.github.com/users/tjmcclure0501/following{/other_user}","gists_url":"https://api.github.com/users/tjmcclure0501/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcclure0501/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcclure0501/subscriptions","organizations_url":"https://api.github.com/users/tjmcclure0501/orgs","repos_url":"https://api.github.com/users/tjmcclure0501/repos","events_url":"https://api.github.com/users/tjmcclure0501/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcclure0501/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-12T22:04:45Z","updated_at":"2016-02-15T14:12:03Z","closed_at":"2016-02-15T14:12:03Z","body":"Below is my code.  I get a connection failure when I try to connect to the remote zookeeper/kafka server.  Strangely when I bring zookeeper and kafka up on my development machine the code works.  I seems like that code is always looking to connect to localhost even though I am passing in the URL.  Any help will be appreciated.\r\n\r\nTim\r\n\r\nvar kafka = require('kafka-node');\r\nvar client = new kafka.Client(\"msg.strax.co:2181\",\"media_server\",{ retries : 2 });\r\nvar producer = new kafka.Producer(client);\r\n\r\n\r\nproducer.on('ready', function () {\r\n\r\n    producer.createTopics(['test'], false, function (err, data) {\r\n        if (err) {\r\n            console.log(err);\r\n        }\r\n        else {\r\n            console.log(data);\r\n        }\r\n    });\r\n});\r\n\r\nproducer.on('error', function (err) {\r\n    console.log(err);\r\n});"},"comment":{"url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/comments/184222034","html_url":"https://github.com/SOHU-Co/kafka-node/issues/329#issuecomment-184222034","issue_url":"https://api.github.com/repos/SOHU-Co/kafka-node/issues/329","id":184222034,"user":{"login":"tjmcclure0501","id":10501891,"avatar_url":"https://avatars.githubusercontent.com/u/10501891?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmcclure0501","html_url":"https://github.com/tjmcclure0501","followers_url":"https://api.github.com/users/tjmcclure0501/followers","following_url":"https://api.github.com/users/tjmcclure0501/following{/other_user}","gists_url":"https://api.github.com/users/tjmcclure0501/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmcclure0501/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmcclure0501/subscriptions","organizations_url":"https://api.github.com/users/tjmcclure0501/orgs","repos_url":"https://api.github.com/users/tjmcclure0501/repos","events_url":"https://api.github.com/users/tjmcclure0501/events{/privacy}","received_events_url":"https://api.github.com/users/tjmcclure0501/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T14:12:03Z","updated_at":"2016-02-15T14:12:03Z","body":"That was the issue - I needed to set the advertised host name for kafka running in my docker container."}}