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
The problem is that to integrate with Express, express-ws will create a 'fake' suffixed GET route that applies all the specified middleware, before actually doing anything with the WebSocket. To create this fake route, it must add a suffix like .websocket at the end, to make sure it doesn't conflict with existing routes.
However, in the case of a regular expression, you can't just "add a string at the end". While it might be possible to implement this, it would involve a very carefully written regex-aware implementation of the suffixing code.
This is complicated by the fact that Express has multiple route formats, not all of which are documented, including a string-based regex-containing one.
I might take a crack at this in the future when I can find the time, but for now the easiest workaround would be to just use string-based route parameters, and handle 'validation' of the parameters within the route itself.
I agree @joepie91 and that's what I've done for now. I did consider updating the code and issuing a pull request, but like you, I realized it was going to be quite a bit of work and require a good few unit tests.
Likewise, if I find some free time I'll take a look at it - I'll let you know first of course.
I'm trying to use:
But it's throwing an error on line 18 of websocket-url.js because it's always assuming a string:
The text was updated successfully, but these errors were encountered: