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

feat: add support for dynamic namespaces (WIP) #3195

Merged

Conversation

darrachequesne
Copy link
Member

@darrachequesne darrachequesne commented Mar 8, 2018

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behaviour

New behaviour

The following test should describe the expected behaviour:

const socket = client(srv, '/dynamic-101');
io.of(/^\/dynamic-\d+$/).on('connect', (socket) => {
  // socket.nsp.name = '/dynamic-101'
});

socket.on('error', function(err) {
  expect().fail();
});
socket.on('connect', () => {
  // ...
});

Other information (e.g. related issues)

@darrachequesne darrachequesne merged commit ac945d1 into socketio:master Mar 29, 2018
@darrachequesne darrachequesne deleted the feat/dynamic-namespace-2 branch March 29, 2018 21:08
@darrachequesne darrachequesne added this to the 2.1.0 milestone Mar 29, 2018
@xaqbr
Copy link

xaqbr commented Apr 18, 2018

Is there a way to pass data into next when using a function to create dynamic namespaces?

@darrachequesne darrachequesne mentioned this pull request Nov 20, 2018
5 tasks
dzad pushed a commit to dzad/socket.io that referenced this pull request May 29, 2023
This follows socketio#3187, with a slightly different API.

A dynamic namespace can be created with:

```js
io.of(/^\/dynamic-\d+$/).on('connect', (socket) => { /* ... */ });
```
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

2 participants