{"action":"created","issue":{"url":"https://api.github.com/repos/websocket-rails/websocket-rails/issues/382","labels_url":"https://api.github.com/repos/websocket-rails/websocket-rails/issues/382/labels{/name}","comments_url":"https://api.github.com/repos/websocket-rails/websocket-rails/issues/382/comments","events_url":"https://api.github.com/repos/websocket-rails/websocket-rails/issues/382/events","html_url":"https://github.com/websocket-rails/websocket-rails/issues/382","id":117013603,"number":382,"title":"How to detect a server disconnect from the client-side?","user":{"login":"Qqwy","id":5345745,"avatar_url":"https://avatars.githubusercontent.com/u/5345745?v=3","gravatar_id":"","url":"https://api.github.com/users/Qqwy","html_url":"https://github.com/Qqwy","followers_url":"https://api.github.com/users/Qqwy/followers","following_url":"https://api.github.com/users/Qqwy/following{/other_user}","gists_url":"https://api.github.com/users/Qqwy/gists{/gist_id}","starred_url":"https://api.github.com/users/Qqwy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qqwy/subscriptions","organizations_url":"https://api.github.com/users/Qqwy/orgs","repos_url":"https://api.github.com/users/Qqwy/repos","events_url":"https://api.github.com/users/Qqwy/events{/privacy}","received_events_url":"https://api.github.com/users/Qqwy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-15T19:56:25Z","updated_at":"2015-11-16T15:02:39Z","closed_at":null,"body":"I want to display a message like `The connection with the server has been lost` when the connection closes unexpectedly (Because, for instance, the server has crashed, or the internet connection of the user failed).\r\n\r\nHow can I listen to such an event?\r\nI believe this would be useful information to add to the [Using the Javascript Client](https://github.com/websocket-rails/websocket-rails/wiki/Using-the-JavaScript-Client) page."},"comment":{"url":"https://api.github.com/repos/websocket-rails/websocket-rails/issues/comments/157060199","html_url":"https://github.com/websocket-rails/websocket-rails/issues/382#issuecomment-157060199","issue_url":"https://api.github.com/repos/websocket-rails/websocket-rails/issues/382","id":157060199,"user":{"login":"a-leung","id":1755768,"avatar_url":"https://avatars.githubusercontent.com/u/1755768?v=3","gravatar_id":"","url":"https://api.github.com/users/a-leung","html_url":"https://github.com/a-leung","followers_url":"https://api.github.com/users/a-leung/followers","following_url":"https://api.github.com/users/a-leung/following{/other_user}","gists_url":"https://api.github.com/users/a-leung/gists{/gist_id}","starred_url":"https://api.github.com/users/a-leung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-leung/subscriptions","organizations_url":"https://api.github.com/users/a-leung/orgs","repos_url":"https://api.github.com/users/a-leung/repos","events_url":"https://api.github.com/users/a-leung/events{/privacy}","received_events_url":"https://api.github.com/users/a-leung/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T15:02:39Z","updated_at":"2015-11-16T15:02:39Z","body":"I believe adding a function to the `onclose` method will work. "}}