'Preventing SocketIO Not To Create Namespace

I have a question about dynamic namespaces in socket.io.

I implemented a dynamic namespace with regex in socket.io and when a client want to join to namespace I want to be sure that if the client has authorization to join this namespace or not.

To handle this I added a middleware for dynamic namespaces to authorize client.

Here is the problem; in first time(namespace did not created yet) when a client want to join namespace(client does not have authorization), the namespace is created automatically by socket.io

Here is what I need; I do not want that socket.io creates namespace if the client has no authorization for namespace.

I search for that but I could not find anything about that.

Does socket.io has ability to handle this requirement?

Thank you very much



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source