{"action":"created","issue":{"url":"https://api.github.com/repos/socketio/socket.io/issues/1921","labels_url":"https://api.github.com/repos/socketio/socket.io/issues/1921/labels{/name}","comments_url":"https://api.github.com/repos/socketio/socket.io/issues/1921/comments","events_url":"https://api.github.com/repos/socketio/socket.io/issues/1921/events","html_url":"https://github.com/socketio/socket.io/pull/1921","id":52519487,"number":1921,"title":"Support dynamic namespaces","user":{"login":"dylanlingelbach","id":213594,"avatar_url":"https://avatars.githubusercontent.com/u/213594?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanlingelbach","html_url":"https://github.com/dylanlingelbach","followers_url":"https://api.github.com/users/dylanlingelbach/followers","following_url":"https://api.github.com/users/dylanlingelbach/following{/other_user}","gists_url":"https://api.github.com/users/dylanlingelbach/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanlingelbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanlingelbach/subscriptions","organizations_url":"https://api.github.com/users/dylanlingelbach/orgs","repos_url":"https://api.github.com/users/dylanlingelbach/repos","events_url":"https://api.github.com/users/dylanlingelbach/events{/privacy}","received_events_url":"https://api.github.com/users/dylanlingelbach/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/socketio/socket.io/labels/needs%20documentation","name":"needs documentation","color":"fad8c7"},{"url":"https://api.github.com/repos/socketio/socket.io/labels/Needs%20Review","name":"Needs Review","color":"00FF0D"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2014-12-19T19:29:56Z","updated_at":"2015-08-18T20:05:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/socketio/socket.io/pulls/1921","html_url":"https://github.com/socketio/socket.io/pull/1921","diff_url":"https://github.com/socketio/socket.io/pull/1921.diff","patch_url":"https://github.com/socketio/socket.io/pull/1921.patch"},"body":"This is another attempt to fix #1854.  It is much more limited in its approach (no automatic disconnects and no host support - as in #1865).\r\n\r\nI'm new to the code base so not sure if this is the right approach - open to feedback on how I'm doing this.  The questions I have with my approach:\r\n- Does it make sense to set up another middleware path for this?  Or should I allow unknown namespaces to flow through to the existing middleware path and then tear down the connection if the namespace isn't found (or is disallowed)?\r\n- Should I pass more than just the name of the namespace to give the server more discretion in allowing the new namespace?\r\n- Is there a better name than `useNamespace` for adding the middleware?  Name feels odd but couldn't think of anything better.\r\n\r\nThanks to @davidbau for #1865 which got me going in the right direction."},"comment":{"url":"https://api.github.com/repos/socketio/socket.io/issues/comments/132334268","html_url":"https://github.com/socketio/socket.io/pull/1921#issuecomment-132334268","issue_url":"https://api.github.com/repos/socketio/socket.io/issues/1921","id":132334268,"user":{"login":"dylanlingelbach","id":213594,"avatar_url":"https://avatars.githubusercontent.com/u/213594?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanlingelbach","html_url":"https://github.com/dylanlingelbach","followers_url":"https://api.github.com/users/dylanlingelbach/followers","following_url":"https://api.github.com/users/dylanlingelbach/following{/other_user}","gists_url":"https://api.github.com/users/dylanlingelbach/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanlingelbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanlingelbach/subscriptions","organizations_url":"https://api.github.com/users/dylanlingelbach/orgs","repos_url":"https://api.github.com/users/dylanlingelbach/repos","events_url":"https://api.github.com/users/dylanlingelbach/events{/privacy}","received_events_url":"https://api.github.com/users/dylanlingelbach/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T20:05:00Z","updated_at":"2015-08-18T20:05:00Z","body":"@CxRes - ah, got it. The tests I add show how to use the feature if that helps. Basically you add a function that validates namespaces as they come in. If your validator accepts the namespace the appropriate objects are created. If not, the current behavior will happen.\r\n\r\nYou should be able to grab the code off of the markitx/socket.io fork. If you need a more recent version let me know - I haven't taken the time to keep this PR up to date with master"}}