You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to setup default namespace '/'?
If I fire: io.setupNamespace('/', function (nsp) { }
It is called for default namespace but if I use middleware inside it's called for all custom namespaces too.
What I want to achieve is – disallow connections to no namespace. My idea was – decline connection with error in middleware. Any idea?
The text was updated successfully, but these errors were encountered:
Good question. I haven't looked at the code for a while, but my
recollection is that the default namespace is used for bootstrapping
connections to other specific namespaces, so there may be subtleties in
disabling it. If you do look into it and come up with a patch, I'd be
happy to review.
On Tue, Oct 6, 2015 at 10:45 AM, Seweryn Zeman [email protected]
wrote:
Is there a way to setup default namespace '/'?
If I fire:
io.setupNamespace('/', function (nsp) {
}
It is called for default namespace but if I use middleware inside it's
called for all custom namespaces too.
What I want to achieve is – disallow connections to no namespace. My idea
was – decline connection with error in middleware. Any idea?
—
Reply to this email directly or view it on GitHub #2.
Yes, I already noticed it is used always as bootstrapped connection in the beginning. And also I guess it cannot change because while Socket.IO starts – it needs at least one point to be setup. For now I designed my emitter so it will use only channels and nsps when emitting, so as long as I'm not gonna use socket.broadcast.emit() it's gonna be fine I guess. But I'll need further investigation on security. I'll also take a look further and send you merge requests when something nice found. :)
Is there a way to setup default namespace '/'?
If I fire:
io.setupNamespace('/', function (nsp) { }
It is called for default namespace but if I use middleware inside it's called for all custom namespaces too.
What I want to achieve is – disallow connections to no namespace. My idea was – decline connection with error in middleware. Any idea?
The text was updated successfully, but these errors were encountered: