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
[2.8.x] Add WebSocket ping/pong support #11521
Merged
Merged
Conversation
This file contains 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
Closed
This was referenced Oct 28, 2022
Closed
I have added a workaround to this as mentioned here: https://stackoverflow.com/questions/73904123/play-framework-persistent-websocket-connection Just thought of sharing! |
mkurz
force-pushed
the
add_ws_ping_pong_support
branch
from
November 1, 2022 08:13
3a552f1
to
0e96d0d
Compare
ihostage
reviewed
Nov 1, 2022
LGTmyself, we have tests, we have docs, I thought hard about the problem 😉 Will merge after CI agrees |
mkurz
force-pushed
the
add_ws_ping_pong_support
branch
from
November 1, 2022 11:42
74e9cf6
to
b30b8ae
Compare
Nice work, Matthias! 👍 |
@Mergifyio backport main |
✅ Backports have been created
|
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.
Finally.
Fixes #3861
Fixes #9209
Fixes #10119
Fixes akka/akka-http#4147
Needs
With this patch one can set
in
application.conf
(orPlayKeys.devSettings
for dev mode) to ping the client after the server didn't hear anything from it after 10 seconds. This is exactly the way how it works in akka-http as well. You might also want to look at the notes in the RFC about the ping and pong frames.This was inspired by akka-http's implementation, however I did not implement a custom payload for the frames. Not sure if that's even important for someone.
Also, this is not akka-http specific, it's implemented backend agnostic, so it work with the netty backend as well.
I did lots of testing on this and it works absolutly great.