{"action":"created","issue":{"url":"https://api.github.com/repos/jprante/elasticsearch-transport-websocket/issues/2","labels_url":"https://api.github.com/repos/jprante/elasticsearch-transport-websocket/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jprante/elasticsearch-transport-websocket/issues/2/comments","events_url":"https://api.github.com/repos/jprante/elasticsearch-transport-websocket/issues/2/events","html_url":"https://github.com/jprante/elasticsearch-transport-websocket/issues/2","id":30924264,"number":2,"title":"use with node.js websocket?","user":{"login":"rpedela","id":1952582,"avatar_url":"https://avatars.githubusercontent.com/u/1952582?v=3","gravatar_id":"","url":"https://api.github.com/users/rpedela","html_url":"https://github.com/rpedela","followers_url":"https://api.github.com/users/rpedela/followers","following_url":"https://api.github.com/users/rpedela/following{/other_user}","gists_url":"https://api.github.com/users/rpedela/gists{/gist_id}","starred_url":"https://api.github.com/users/rpedela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpedela/subscriptions","organizations_url":"https://api.github.com/users/rpedela/orgs","repos_url":"https://api.github.com/users/rpedela/repos","events_url":"https://api.github.com/users/rpedela/events{/privacy}","received_events_url":"https://api.github.com/users/rpedela/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-04-05T21:17:35Z","updated_at":"2015-01-12T08:24:30Z","closed_at":"2014-04-10T03:27:37Z","body":"I am trying to simply connect right now, but it is not working due to ES returning status code 200 instead of 101. It very easily could be that I am using the wrong URL, port, etc. I am not even sure how to debug this, so any pointers would be helpful.\r\n\r\nInstall\r\n```\r\nnpm install websocket\r\n```\r\n\r\nCode\r\n```js\r\nvar WebSocketClient = require('websocket').client;\r\n\r\nvar ws = new WebSocketClient();\r\nws.connect('ws://localhost:9400/_stats');\r\nws.on('connect', function(connection) {\r\n\tconsole.log('connected!');\r\n});\r\nws.on('connectFailed', function(err) {\r\n\tconsole.log('ERROR: ' + err);\r\n});\r\n```\r\nOutput\r\n```\r\nERROR: Server responded with a non-101 status: 200\r\nResponse Headers Follow:\r\ncontent-type: application/json; charset=UTF-8\r\ncontent-length: 97\r\n```"},"comment":{"url":"https://api.github.com/repos/jprante/elasticsearch-transport-websocket/issues/comments/69539636","html_url":"https://github.com/jprante/elasticsearch-transport-websocket/issues/2#issuecomment-69539636","issue_url":"https://api.github.com/repos/jprante/elasticsearch-transport-websocket/issues/2","id":69539636,"user":{"login":"gaving","id":43741,"avatar_url":"https://avatars.githubusercontent.com/u/43741?v=3","gravatar_id":"","url":"https://api.github.com/users/gaving","html_url":"https://github.com/gaving","followers_url":"https://api.github.com/users/gaving/followers","following_url":"https://api.github.com/users/gaving/following{/other_user}","gists_url":"https://api.github.com/users/gaving/gists{/gist_id}","starred_url":"https://api.github.com/users/gaving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaving/subscriptions","organizations_url":"https://api.github.com/users/gaving/orgs","repos_url":"https://api.github.com/users/gaving/repos","events_url":"https://api.github.com/users/gaving/events{/privacy}","received_events_url":"https://api.github.com/users/gaving/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T08:24:30Z","updated_at":"2015-01-12T08:24:30Z","body":"Ah, no worries. Are you now just polling with the official client?\r\n\r\nBasically trying to get some subscription/push going on but until https://github.com/elasticsearch/elasticsearch/issues/1242 is sorted it looks like I'm running out of options!"}}