Closed jhoughjr closed 1 year ago
@0xTim You are not serious, are you? As much as I like Vapor and use it every day, websocket-kit has had multiple breaking changes in the last years. Most recently, one of the latest releases (with the Sendable stuff) broke literally every single app I had using websocket-kit directly, within a minor version. And I can prove it if you need to.
There is literally no QA going on in any of the Vapor repositories. I trust @adam-fowler with compress-nio in a pre-1.0 version 10000% more than any of the Vapor repositories, especially websocket-kit, to not introduce any breaking changes.
Copying over code will very surely introduce another weak point in a barely maintained repository. I and surely many others would much rather depend on a maintained version of code doing a crucial part of what's being implemented in this PR.
If you really insist, why not simply version-lock it? Or reduce to bug-fix releases only? And then manually update the dependency if it makes (probably non-breaking) minor bumps.
This PR is very good and feature-complete. It even takes care of edge cases covered in the RFC. It introduces a long-awaited feature that is a crucial part of any real websocket library in any language. Vapor being the de-facto library used for Swift backends, you are the only one of any languages I know without websocket compression support. I would put priority on getting this merged ASAP.
A thorough code review will follow.
Also want to mention this exists
As per this comment you could consider integration testing with other implementations
Merging #142 (a6ef521) into main (ffe0055) will decrease coverage by
19.74%
. The diff coverage is41.09%
.:exclamation: Current head a6ef521 differs from pull request most recent head 756216d. Consider uploading reports for the commit 756216d to get more accurate results
The coverage seems odd to drop so much. I only removed a skipped test and added some that werent there. I don't understand that result.
@0xTim You are not serious, are you?
@0xTim is right here to question relying on a package that hasn't hit v1.0. CompressNIO has had a number of breaking changes in the last few releases. Although many of those have been to add support needed by both this PR and the equivalent in hummingbird-websocket.
To make things easier I will move compress-nio to v1.0 in the next week or so.
@adam-fowler Thanks a ton. Your quick responsiveness and guidance has been instrumental in getting this done on time for me.
@jhoughjr I just released compress-nio v1.0 so you can update to that and it won't be an issue anymore
Thank you @adam-fowler
Thought I pushed yesterday, seemed today it didnt go so pushed it now.
Hey @jhoughjr any particular reason this was closed? With the recent changes and compression 1.0 this was getting into a good shape
My first PR is PMCE support for WebSocket server and client.
There is an accompanying PR going to Vapor to support the changes to the WebSocketUpgrader to enable conditional use of PMCE.
I've tried to comment everything as descriptive as possible but without knowledge of the RFC, the code may not make obvious sense.
The changes are mostly encapsulated in the new PMCE class and its members. Websocket's main changes are an optional PMCE which is Sendable and some optional delegation to it if configured and enabled for use in the send and handle methods.
WebSocketClient.Configuration also has an optional PMCE so the client can configure its side. The public API is mainly through converting DeflateConfigs <> HTTPHeaders. ie if you want to serve pace web sockets, create the desire DeflateConfig and grab its headers. Pass them out of shouldUpgrade. As a client, do the same and pass them into the connect override with the ClientConfiguration.
I have some test apps and examples in another repo and am contiuning to write documentation. I have tested client against a node.js , a go and a vapor/websocketkit (this) implementation of PMCE servers. I have tested the vapor/websocket-kit server against the vapor/websocket-kit client, and a web browser client, all of which works, but I'm sure its not perfect yet.
I believe MahdiBM has some experience with this issue as well as adamfowler and may be useful ion review. I can answer any questions in discord.