{"action":"opened","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/1054","labels_url":"https://api.github.com/repos/manastech/crystal/issues/1054/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1054/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/1054/events","html_url":"https://github.com/manastech/crystal/issues/1054","id":97813603,"number":1054,"title":"HTTP:WebSocket::PacketInfo raises error on type HTTP:WebSocket::OPCODE_CLOSE","user":{"login":"fkchang","id":13941,"avatar_url":"https://avatars.githubusercontent.com/u/13941?v=3","gravatar_id":"","url":"https://api.github.com/users/fkchang","html_url":"https://github.com/fkchang","followers_url":"https://api.github.com/users/fkchang/followers","following_url":"https://api.github.com/users/fkchang/following{/other_user}","gists_url":"https://api.github.com/users/fkchang/gists{/gist_id}","starred_url":"https://api.github.com/users/fkchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkchang/subscriptions","organizations_url":"https://api.github.com/users/fkchang/orgs","repos_url":"https://api.github.com/users/fkchang/repos","events_url":"https://api.github.com/users/fkchang/events{/privacy}","received_events_url":"https://api.github.com/users/fkchang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-28T22:16:30Z","updated_at":"2015-07-28T22:16:30Z","closed_at":null,"body":"if a connected javascript client calls ```websocket.close()``` you will get 'Invalid packet type' error raised. The case statement in PacketInfo#initialize does not handle this opcode.  I think this needs to handle this, and changes propagate else where.  My guess on what needs to happen\r\n\r\n* handle this opcode on PacketInfo\r\n* update WebSocketHandler to now handle the close case in WebSocketSession and send back close frame to the client\r\n* add a close method to TCPSocket, so that it can be closed"}}