Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client cannot connect to non-existing namespaces #1688

Merged
merged 1 commit into from Aug 1, 2014

Conversation

fdellabetta
Copy link
Contributor

Namespaces should be allocated only by the server using of

sio.of('<namespace>').on(...)

A client cannot connect to a namespace not allocated by the server.

Please check it @guille

Thanks @smaffer
#1681

@calendee
Copy link

calendee commented Aug 1, 2014

This would be very useful. I'd love to be able to create nsps on the server after some authentication mechanism. Then, the client can only connect to that specific nsp. If they connect to the default nsp, they are automatically disconnected.

rauchg added a commit that referenced this pull request Aug 1, 2014
client cannot connect to non-existing namespaces
@rauchg rauchg merged commit a40068b into socketio:master Aug 1, 2014
@dylanlingelbach
Copy link

This PR requires that the server create its namespaces upfront, prior to any client connecting to that namespace. In my case this isn't desired behavior. I want to allocate namespaces dynamically on the server and client and have messages flow between them whenever the namespace exists on both the client and the server.

As far as I can tell my clients don't receive an event when the namespace is created on the server to allow me to force a reconnect on the client side to pick up the newly created namespace.

Is creating my namespaces upfront on the server the only way to go?

I'm not sure if my question is the same as #1854.

In any case could the docs at http://socket.io/docs/rooms-and-namespaces/ get updated to point out the namespace must be created on the server prior to a client trying to connect to it? I'm happy to make the edit to the docs and submit a PR - I couldn't find where they live in GitHub. Having that in the docs would have saved me several hours of debugging time.

@rauchg
Copy link
Contributor

rauchg commented Dec 18, 2014

At the moment it is. We should make it so that the server can specify a custom handler for namespace creation so that they can be created dynamically

@dylanlingelbach
Copy link

Added PR #1921 as an attempt at handling dynamic namespaces. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants