-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Add WebSocket compression support #32600
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
Conversation
src/Middleware/WebSockets/src/ExtendedWebSocketAcceptContext.cs
Outdated
Show resolved
Hide resolved
|
No, better to have an explicit on-off switch. |
Sounds like the client is supposed to be able to opt out, so it's fine for them to override servercontext=true. |
At that point, why even expose an option for this? Just in the case where the client doesn't specify an option? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At that point, why even expose an option for this? Just in the case where the client doesn't specify an option?
So the server can also opt-out. It sounds like context takeover uses more memory on both client and server.
|
||
namespace Microsoft.AspNetCore.WebSockets.Test | ||
{ | ||
public class WebSocketCompressionMiddlewareTests : LoggedTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you enabled the autobahn tests yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran it earlier, but wanting to get everything cleaned up before trying again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All Autobahn tests passed
src/Middleware/WebSockets/test/UnitTests/WebSocketCompressionMiddlewareTests.cs
Outdated
Show resolved
Hide resolved
11e2816
to
e8566e0
Compare
🆙 📅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking really good. What's left, autobahn?
src/Middleware/WebSockets/src/ExtendedWebSocketAcceptContext.cs
Outdated
Show resolved
Hide resolved
Yeah, need to do another round of that, would like to figure out if we can make the |
Would we be against moving the new properties to the base WebSocketAcceptContext? Or maybe we can make an extension in the websocket project for |
We'd originally left them separate because the base WebSocketAcceptContext was supposed to be implementation agnostic. Now that we only use one implementation I'm not sure if that matters anymore.
Let's start with that. |
The extension method is a bit weird, it doesn't get called when passing an |
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API review: |
Turns out this is a breaking change. |
So how do we consolidate ExtendedWebSocketAcceptContext? |
We're adding a member to We're still going to |
Fixes #2715
Main questions are around usability. Do we want to allow setting specific deflate options or just have a bool for enabling compression and let the client negotiate choose what it wants to use?
Added an
AcceptWebSocketAsync
overload toWebSocketManager
to see how it looks to pass per connection options.https://tools.ietf.org/html/rfc7692#section-5 for general negotiation details
https://tools.ietf.org/html/rfc7692#section-7 for permessage-deflate details