{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/issues/57","repository_url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript","labels_url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/issues/57/comments","events_url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/issues/57/events","html_url":"https://github.com/eclipse/paho.mqtt.javascript/issues/57","id":144934366,"number":57,"title":"websockify support (websocket binary protocol)","user":{"login":"massimilianogalanti","id":18192861,"avatar_url":"https://avatars.githubusercontent.com/u/18192861?v=3","gravatar_id":"","url":"https://api.github.com/users/massimilianogalanti","html_url":"https://github.com/massimilianogalanti","followers_url":"https://api.github.com/users/massimilianogalanti/followers","following_url":"https://api.github.com/users/massimilianogalanti/following{/other_user}","gists_url":"https://api.github.com/users/massimilianogalanti/gists{/gist_id}","starred_url":"https://api.github.com/users/massimilianogalanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/massimilianogalanti/subscriptions","organizations_url":"https://api.github.com/users/massimilianogalanti/orgs","repos_url":"https://api.github.com/users/massimilianogalanti/repos","events_url":"https://api.github.com/users/massimilianogalanti/events{/privacy}","received_events_url":"https://api.github.com/users/massimilianogalanti/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"jpwsutton","id":1068763,"avatar_url":"https://avatars.githubusercontent.com/u/1068763?v=3","gravatar_id":"","url":"https://api.github.com/users/jpwsutton","html_url":"https://github.com/jpwsutton","followers_url":"https://api.github.com/users/jpwsutton/followers","following_url":"https://api.github.com/users/jpwsutton/following{/other_user}","gists_url":"https://api.github.com/users/jpwsutton/gists{/gist_id}","starred_url":"https://api.github.com/users/jpwsutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpwsutton/subscriptions","organizations_url":"https://api.github.com/users/jpwsutton/orgs","repos_url":"https://api.github.com/users/jpwsutton/repos","events_url":"https://api.github.com/users/jpwsutton/events{/privacy}","received_events_url":"https://api.github.com/users/jpwsutton/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/milestones/1","html_url":"https://github.com/eclipse/paho.mqtt.javascript/milestones/1.2.0%20(Neon)","labels_url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/milestones/1/labels","id":1636998,"number":1,"title":"1.2.0 (Neon)","description":"- Automatic Reconnect & Offline Buffering\r\n- Various Bugfixes","creator":{"login":"jpwsutton","id":1068763,"avatar_url":"https://avatars.githubusercontent.com/u/1068763?v=3","gravatar_id":"","url":"https://api.github.com/users/jpwsutton","html_url":"https://github.com/jpwsutton","followers_url":"https://api.github.com/users/jpwsutton/followers","following_url":"https://api.github.com/users/jpwsutton/following{/other_user}","gists_url":"https://api.github.com/users/jpwsutton/gists{/gist_id}","starred_url":"https://api.github.com/users/jpwsutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpwsutton/subscriptions","organizations_url":"https://api.github.com/users/jpwsutton/orgs","repos_url":"https://api.github.com/users/jpwsutton/repos","events_url":"https://api.github.com/users/jpwsutton/events{/privacy}","received_events_url":"https://api.github.com/users/jpwsutton/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":6,"state":"open","created_at":"2016-03-10T16:31:38Z","updated_at":"2016-05-04T14:28:59Z","due_on":"2016-05-31T23:00:00Z","closed_at":null},"comments":4,"created_at":"2016-03-31T15:28:16Z","updated_at":"2016-05-05T21:32:26Z","closed_at":null,"body":"**Test setup**\r\nmosquitto broker listening on 1883\r\nwebsockify websocket to TCP bridge set up to bridge public-ip:9001 to localhost:1883\r\nsample page subscribing to broker via mqttws31.js\r\n**What happens**\r\nwebsockify refuses connection from client:\r\n`host17-79-dynamic.183-80-r.retail... - - [31/Mar/2016 15:49:20] code 400, message Client must support 'binary' or 'base64' protocol`\r\n**Solution**\r\nI have been able to fix this issue by patching:\r\n`this.socket = new WebSocket(wsurl, [\"mqttv3.1\"]);`\r\nto:\r\n`this.socket = new WebSocket(wsurl, [\"binary\"]);`\r\n**Request**\r\nstill I think that a proper option could be added to paho.MQTT.Client class to support this scenario, something like:\r\n`\r\n var options = {\r\n            binaryMode: true,\r\n`\r\nor some explicit string option override.\r\n\r\nthank you!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/issues/comments/217286270","html_url":"https://github.com/eclipse/paho.mqtt.javascript/issues/57#issuecomment-217286270","issue_url":"https://api.github.com/repos/eclipse/paho.mqtt.javascript/issues/57","id":217286270,"user":{"login":"miketran78727","id":11527566,"avatar_url":"https://avatars.githubusercontent.com/u/11527566?v=3","gravatar_id":"","url":"https://api.github.com/users/miketran78727","html_url":"https://github.com/miketran78727","followers_url":"https://api.github.com/users/miketran78727/followers","following_url":"https://api.github.com/users/miketran78727/following{/other_user}","gists_url":"https://api.github.com/users/miketran78727/gists{/gist_id}","starred_url":"https://api.github.com/users/miketran78727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miketran78727/subscriptions","organizations_url":"https://api.github.com/users/miketran78727/orgs","repos_url":"https://api.github.com/users/miketran78727/repos","events_url":"https://api.github.com/users/miketran78727/events{/privacy}","received_events_url":"https://api.github.com/users/miketran78727/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T21:32:26Z","updated_at":"2016-05-05T21:32:26Z","body":"I am wondering if we can specify more than one subprotocol, e.g.\r\nthis.socket = new WebSocket(wsurl, [\"binary\",\"mqttv3.1\"]);"}}