{"action":"closed","issue":{"url":"https://api.github.com/repos/lipp/lua-websockets/issues/48","labels_url":"https://api.github.com/repos/lipp/lua-websockets/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/lipp/lua-websockets/issues/48/comments","events_url":"https://api.github.com/repos/lipp/lua-websockets/issues/48/events","html_url":"https://github.com/lipp/lua-websockets/issues/48","id":57653459,"number":48,"title":"\"bad protocol\" Error","user":{"login":"drasko","id":149944,"avatar_url":"https://avatars.githubusercontent.com/u/149944?v=3","gravatar_id":"","url":"https://api.github.com/users/drasko","html_url":"https://github.com/drasko","followers_url":"https://api.github.com/users/drasko/followers","following_url":"https://api.github.com/users/drasko/following{/other_user}","gists_url":"https://api.github.com/users/drasko/gists{/gist_id}","starred_url":"https://api.github.com/users/drasko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drasko/subscriptions","organizations_url":"https://api.github.com/users/drasko/orgs","repos_url":"https://api.github.com/users/drasko/repos","events_url":"https://api.github.com/users/drasko/events{/privacy}","received_events_url":"https://api.github.com/users/drasko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-13T21:01:09Z","updated_at":"2015-02-13T22:12:10Z","closed_at":"2015-02-13T22:12:10Z","body":"I tried with several WebSocket clients and I am constantly getting \"bad protocol\" error.\r\n\r\nIs the code functional?\r\n\r\nI am using an example \"copas echo server\" with freshly installed lua5.1 on Debian Linux:\r\n\r\n```bash\r\ndrasko@Lenin:~/lua$ lua5.1 server.lua \r\nbad protocol\r\n```\r\n\r\nI tried test with both this code from the browser (both Chrome and Firefox):\r\n```html\r\n<!doctype html>\r\n<html><head>\r\n    <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\"></script>\r\n    <link href=\"bootstrap/css/bootstrap.min.css\" rel=\"stylesheet\">\r\n    <script src=\"bootstrap/js/bootstrap.min.js\"></script>\r\n\r\n    </head>\r\n\r\n    <body lang=\"en\">\r\n    <h1>WebSocket Echo example</h1>\r\n    <button id=\"btnTest\" type=\"button\" class=\"btn btn-primary btn-lg\">Primary</button>\r\n\r\n\r\n    <script>\r\n        var port = \"8080\";\r\n        var uri = \"/\";\r\n        var host = \"localhost\";\r\n        ws = new WebSocket(\"ws://\" + host + \":\" + port + uri);\r\n        ws.onopen    = function()  {console.log('[*] open', ws.protocol);};\r\n        ws.onclose   = function()  {console.log('[*] close');};\r\n        $(document).ready(function(){\r\n\t\t\t$(\"#btnTest\").click(function(){\r\n\t\t\t\tws.send(\"TEST\");\r\n\t\t\t});\r\n\t\t});\r\n    </script>\r\n\r\n</body></html>\r\n```\r\n\r\nAnd also this code from Python: https://github.com/liris/websocket-client\r\n\r\nSame result - \"bad protocol\".\r\n\r\nBest regards,\r\nDrasko"}}