WebSocketServer handshake handling#64
Merged
aecsocket merged 1 commit intoaecsocket:mainfrom Sep 25, 2025
Merged
Conversation
aecsocket
requested changes
Sep 24, 2025
Owner
aecsocket
left a comment
There was a problem hiding this comment.
Thanks for the PR! This is something that I've been meaning to get around to doing, you can tell by the TODO, but I never found the time to implement it. The method of passing a callback isn't ideal - if possible I would like to use the ECS directly here like running a system or a trigger - but I don't think that's really possible to achieve with how tungstenite works, so I'm happy with the callback approach.
I'm very happy with the PR overall, just would like some minor tweaks to docs and implementation.
Owner
|
Also please make sure that CI clippy and doctests pass |
25a03df to
7a5c6e5
Compare
Contributor
Author
|
Great suggestions, thanks @aecsocket. |
Owner
|
Thanks for the fixes! I'll merge it now and do a 0.16.1 release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, thanks for the crate!
I've added a
HandshakeHandlerto the wsServerConfig, allowing auth check(s) during http handshake rather than needing to wait until the connection is upgraded.Useful for implementing low cost auth check like the netcode connect tokens.
The new config entry is optional, so no breaking changes.
Example creating a
WebSocketServerwith a customHandshakeHandler: