Releases: vapor/websocket-kit
2.15.0 - Allow `send(_ binary:)` to accept `some DataProtocol`
What's Changed
Allow send(_ binary:)
to accept some DataProtocol
by @fizker in #146
This allows for passing in
Data
orByteBufferView
tosend(_:)
, as well as the currently-supported[UInt8]
type.
This patch was released by @0xTim
Full Changelog: 2.14.0...2.15.0
Pass a copy of the control frame buffer to ping/pong callbacks
This patch was authored by @tkrajacic and released by @0xTim.
This PR enables access to the data in the control frames handled via onPing
/onPong
via a new API with the existing onPing
and onPong
methods being deprecated.
Bump the swift-tools-version to 5.7
Revert Sendable Take 2
Reverts 2.12.0, in order to maintain compatibility with Swift 5.6 users.
Sendable Take 2
This patch was authored and released by @0xTim.
Adds Sendable
annotations where possible. This time we're using @preconcurrency
to suppress errors in unsafe code from downstream users
Revert "Add Sendable conformances to WebsocketKit (#131)"
This patch was authored and released by @gwynne.
Due to unforeseen source compatibility breakage, this backs out the changes from release 2.10.0 for now.
Add Sendable conformances to WebsocketKit
This patch was authored and released by @0xTim.
Bump minimum Swift version to 5.6 and add Sendable conformances where appropriate
Work around apple/swift#66099
This patch was authored and released by @gwynne.
Avoids hitting swiftlang/swift#66099. Holding off on reenabling TSan in CI for now due to remaining warnings about race conditions managing callbacks.
Update for new NIOSSL
This patch was authored and released by @gwynne.
Fix for SwiftNIOSSL 2.23.1 breaking the build of the WebSocket tests due to EVP_PKEY
no longer being visible.
Shoutout and thanks to @jhoughjr for reporting the problem!
Additional changes:
- Require Swift 5.6 (matching the rest of Vapor)
- Update CI (wouldn't be an @gwynne PR without CI tweaks!)
- Enable Concurrency back-deployment
- Normalize platform support
- Some very minor code quality cleanups
- Added several missing tests (binary frames, manual pings, automatic pings, various connect methods)
Add support for proxying in `WebsocketClient`
This patch was authored by @rnro and released by @0xTim.
Added support for TLS and plain text proxying of Websocket traffic.
-
In the TLS case a
CONNECT
header is first sent establishing the proxied traffic. -
In the plain text case the modified URI in the initial upgrade request header indicates to the proxy server that the traffic is to be proxied.
-
Use
NIOWebSocketFrameAggregator
to handle aggregating frame fragments. This brings with it more protections e.g. against memory exhaustion. -
Accompanying config has been added to support this change.
This change also includes some performance gains by reducing the allocation and copies necessary to send ByteBuffer
and ByteBufferView
through WebSocket.send
.
-
Sending
ByteBuffer
orByteBufferView
doesn’t require any allocation or copy of the data. Sending aString
now correctly pre allocates theByteBuffer
if multibyte characters are present in theString
. -
Remove custom random websocket mask generation which would only generate bytes between
UInt8.min..<UInt8.max
, therefore excludingUInt8.max
i.e.255
.