{"action":"created","issue":{"url":"https://api.github.com/repos/mattstyles/koa-socket/issues/16","repository_url":"https://api.github.com/repos/mattstyles/koa-socket","labels_url":"https://api.github.com/repos/mattstyles/koa-socket/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/mattstyles/koa-socket/issues/16/comments","events_url":"https://api.github.com/repos/mattstyles/koa-socket/issues/16/events","html_url":"https://github.com/mattstyles/koa-socket/issues/16","id":147896126,"number":16,"title":"Middleware Not Fired Before \"connection\" event","user":{"login":"thealexbaron","id":1231873,"avatar_url":"https://avatars.githubusercontent.com/u/1231873?v=3","gravatar_id":"","url":"https://api.github.com/users/thealexbaron","html_url":"https://github.com/thealexbaron","followers_url":"https://api.github.com/users/thealexbaron/followers","following_url":"https://api.github.com/users/thealexbaron/following{/other_user}","gists_url":"https://api.github.com/users/thealexbaron/gists{/gist_id}","starred_url":"https://api.github.com/users/thealexbaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thealexbaron/subscriptions","organizations_url":"https://api.github.com/users/thealexbaron/orgs","repos_url":"https://api.github.com/users/thealexbaron/repos","events_url":"https://api.github.com/users/thealexbaron/events{/privacy}","received_events_url":"https://api.github.com/users/thealexbaron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-12T22:51:33Z","updated_at":"2016-04-15T22:27:02Z","closed_at":null,"body":"Pardon my ignorance, but why aren't middlewares fired before the `connection` event? If this isn't clear, I have an example handy.\r\n\r\nShould my client simply trigger a separate event once it has received a connected event or something? Thanks in advance."},"comment":{"url":"https://api.github.com/repos/mattstyles/koa-socket/issues/comments/210669183","html_url":"https://github.com/mattstyles/koa-socket/issues/16#issuecomment-210669183","issue_url":"https://api.github.com/repos/mattstyles/koa-socket/issues/16","id":210669183,"user":{"login":"thealexbaron","id":1231873,"avatar_url":"https://avatars.githubusercontent.com/u/1231873?v=3","gravatar_id":"","url":"https://api.github.com/users/thealexbaron","html_url":"https://github.com/thealexbaron","followers_url":"https://api.github.com/users/thealexbaron/followers","following_url":"https://api.github.com/users/thealexbaron/following{/other_user}","gists_url":"https://api.github.com/users/thealexbaron/gists{/gist_id}","starred_url":"https://api.github.com/users/thealexbaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thealexbaron/subscriptions","organizations_url":"https://api.github.com/users/thealexbaron/orgs","repos_url":"https://api.github.com/users/thealexbaron/repos","events_url":"https://api.github.com/users/thealexbaron/events{/privacy}","received_events_url":"https://api.github.com/users/thealexbaron/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T22:27:01Z","updated_at":"2016-04-15T22:27:01Z","body":"To give a bit more context: I have a global session store which I look at to decide if the user is authenticated. Users should receive \"authentication error\" before they receive the connection. \r\n\r\nDoes this seem reasonable?"}}