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
Enable Websocket compression for Netty #11169
Conversation
@mkurz Hopefully this looks good, let me know in case of any changes or questions. |
Thanks! The test in the netty-reactive-streams repo is broken. |
Fixed, I was using Java 11, and missed the
I agree. Honestly, I was not certain where this would be placed. I will add a test similar to the |
FYI, got caught up in some work but the integration test is a WIP and should be done by this weekend. |
No hurry, I am busy with other stuff this week as well 😉 |
@TheAntimist are you still willing to work on this pull request? |
@mkurz Apologies I got busy with some other personal things and also an internship in between. I cannot find the work that I had completed on it for some reason. I can continue working on it now. I have a question on the IntegrationTest, would you want me to modify the controllers for the |
You can make use of that existing scripted test. E.g. you can add new routes here and new action methods here, then you should be able to write the test(s) needed. Be aware that here we talk about scripted tests, so you need to run Actually... As an alternative to the scripted test you could add a test here as well if you prefer that: |
Could not re-open this pull request, so I had to create a new one: |
Pull Request Checklist
Helpful things
Fixes
Fixes #10863 and #4186
Purpose
Enable WebSocket Compression for Netty, using the
WebSocketServerCompressionHandler
. Adds the Netty 4.xWebSocketServerCompressionHandler
to the chain of Netty's codecs.Tests have been added to the
netty-reactive-streams
repository, as that seemed the correct place to add them. Let me know in case there's any concerns over this.Tests
Added here: playframework/netty-reactive-streams#126
Background Context
This had to be added here, because if I added it to
HttpStreamsServerHandler
it would be too late for processing, and Compression would not get enabled. This is because it requires detecting of the Websocket Upgrade requests to enable Websocket Extension Headers.References
From the Netty Websocket examples: https://github.com/netty/netty/blob/4.1/example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerInitializer.java#L47