Skip to content

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 force-pushed the feat/dynamic-namespace-2 branch from 7a39fb4 to 0c16257 Compare March 14, 2018 10:01
@darrachequesne darrachequesne force-pushed the feat/dynamic-namespace-2 branch from 0c16257 to 9cead1e Compare March 29, 2018 20:50
@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.

2 participants