socket-controllers icon indicating copy to clipboard operation
socket-controllers copied to clipboard

control namespaces for middlewares

Open sittingbool opened this issue 2 years ago • 2 comments

Description

  • fixes https://github.com/typestack/socket-controllers/issues/261
  • solution: middlewares now have to e added per namespace, therefore I used the socket.io native .of() with a function filter
  • added the possibility to limit usage of middleware by name or regular expression related to the namespace

Checklist

  • [x] the pull request title describes what this PR does (not a vague title like Update index.md)
  • [x] the pull request targets the default branch of the repository (develop)
  • [x] the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • [x] tests are added for the changes I made (if any source code was modified)
  • [x] documentation added or updated
  • [x] I have run the project locally and verified that there are no errors

Fixes

fixes #261

sittingbool avatar Apr 06 '22 12:04 sittingbool

This then has the issue, that on('connection') is no longer being called

See: https://github.com/socketio/socket.io/issues/3082

sittingbool avatar Apr 06 '22 13:04 sittingbool

Thank you for the PR! Could we use the default namespace if no namespace is explicity provided? https://socket.io/docs/v2/namespaces/#default-namespace

This seems to be compatible with the latest version as well.

attilaorosz avatar Apr 09 '22 08:04 attilaorosz

Closing as this has been resolved in #511

attilaorosz avatar Dec 22 '22 16:12 attilaorosz

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jan 22 '23 01:01 github-actions[bot]