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

Websocket endpoints do not send broadcast messages to all connected clients #1280

Closed
huntsman95 opened this issue Apr 4, 2024 · 1 comment · Fixed by #1281
Closed

Websocket endpoints do not send broadcast messages to all connected clients #1280

huntsman95 opened this issue Apr 4, 2024 · 1 comment · Fixed by #1281
Assignees
Labels
Milestone

Comments

@huntsman95
Copy link

I've been struggling with using websocket endpoints in Pode for quite a while because when multiple clients are connected, broadcast messages only send to a single endpoint (typically the one that most recently connected) making this feature rather useless. Rather then open an issue and beg for help, I went through all of the code and figured out the problem. On line 312 of Private/PodeServer.ps1 there is a break command which stops processing the loop and only sends the signal to the first matching path rather than all of them. I don't know why this is in there, but break is breaking this feature. I removed it in a local copy of the module and it fixed this issue for me and I can now use websockets as they are intended to work per the documentation. I propose removing this line to fix this issue:

https://github.com/Badgerati/Pode/blob/c4184424d79e61449f03a58d77967c555f679ccc/src/Private/PodeServer.ps1#L312C45-L312C50

@Badgerati
Copy link
Owner

Yup, agreed. That break shouldn't be there. I'll get it removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants