{"action":"created","issue":{"url":"https://api.github.com/repos/pusher/pusher-websocket-swift/issues/28","repository_url":"https://api.github.com/repos/pusher/pusher-websocket-swift","labels_url":"https://api.github.com/repos/pusher/pusher-websocket-swift/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/pusher/pusher-websocket-swift/issues/28/comments","events_url":"https://api.github.com/repos/pusher/pusher-websocket-swift/issues/28/events","html_url":"https://github.com/pusher/pusher-websocket-swift/issues/28","id":136539030,"number":28,"title":"Websocket disconnected","user":{"login":"rjong","id":9819967,"avatar_url":"https://avatars.githubusercontent.com/u/9819967?v=3","gravatar_id":"","url":"https://api.github.com/users/rjong","html_url":"https://github.com/rjong","followers_url":"https://api.github.com/users/rjong/followers","following_url":"https://api.github.com/users/rjong/following{/other_user}","gists_url":"https://api.github.com/users/rjong/gists{/gist_id}","starred_url":"https://api.github.com/users/rjong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjong/subscriptions","organizations_url":"https://api.github.com/users/rjong/orgs","repos_url":"https://api.github.com/users/rjong/repos","events_url":"https://api.github.com/users/rjong/events{/privacy}","received_events_url":"https://api.github.com/users/rjong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-25T23:04:21Z","updated_at":"2016-02-29T09:21:58Z","closed_at":null,"body":"Hi,\r\nI want to subscribe on a channel to fire a function when the event is send.\r\n\r\nIn the viewDidLoad, I have\r\n```\r\nlet pusher = Pusher(key: Constraints.data.PUSHER_KEY)\r\npusher.connect()\r\nlet chan = pusher.subscribe(\"bestelling\")      \r\nchan.bind(\"nieuwe_bestelling\", callback: { (data: AnyObject?) -> Void in\r\n    if let data = data as? Dictionary<String, AnyObject> {\r\n    if let testVal = data[\"test\"] as? String {\r\n                    print(testVal)\r\n       }\r\n    }\r\n    self.dataOphalen()\r\n })\r\n```\r\n\r\nBut after 2 seconds I'll get: Websocket is disconnected: connection closed by server\r\n\r\nWhat to do?"},"comment":{"url":"https://api.github.com/repos/pusher/pusher-websocket-swift/issues/comments/190118684","html_url":"https://github.com/pusher/pusher-websocket-swift/issues/28#issuecomment-190118684","issue_url":"https://api.github.com/repos/pusher/pusher-websocket-swift/issues/28","id":190118684,"user":{"login":"hamchapman","id":2475150,"avatar_url":"https://avatars.githubusercontent.com/u/2475150?v=3","gravatar_id":"","url":"https://api.github.com/users/hamchapman","html_url":"https://github.com/hamchapman","followers_url":"https://api.github.com/users/hamchapman/followers","following_url":"https://api.github.com/users/hamchapman/following{/other_user}","gists_url":"https://api.github.com/users/hamchapman/gists{/gist_id}","starred_url":"https://api.github.com/users/hamchapman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamchapman/subscriptions","organizations_url":"https://api.github.com/users/hamchapman/orgs","repos_url":"https://api.github.com/users/hamchapman/repos","events_url":"https://api.github.com/users/hamchapman/events{/privacy}","received_events_url":"https://api.github.com/users/hamchapman/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T09:21:58Z","updated_at":"2016-02-29T09:21:58Z","body":"That sounds pretty weird! \r\n\r\nIf you just have \r\n\r\n```\r\nlet pusher = Pusher(key: Constraints.data.PUSHER_KEY)\r\npusher.connect()\r\n```\r\n\r\ndoes the same thing happen?"}}