NIOExtras is a good place for code that is related to NIO but not core. It can also be used to incubate APIs for tasks that are possible with core-NIO but are cumbersome today.
What makes a good contribution to NIOExtras?
- a protocol encoder/decoder pair (also called "codec") that is often used but is small enough so it doesn't need its own repository
- a helper to achieve a task that is harder-than-necessary to achieve with core-NIO
Code Quality / Stability
All code will go through code review like in the other repositories related to the SwiftNIO project.
swift-nio-extras part of the SwiftNIO 2 family of repositories and depends on the following:
swift-nio, version 2.0.0 or better.
- Swift 5.0.
zliband its development headers installed on the system. But don't worry, you'll find
zlibon pretty much any UNIX system that can compile any sort of code.
To depend on
swift-nio-extras, put the following in the
dependencies of your
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.0.0"),
Support for older Swift versions
nio-extras-0.1 branch, you can find the
swift-nio-extras version for the SwiftNIO 1 family. It requires Swift 4.1 or better.
QuiescingHelper: Helps to quiesce a server by notifying user code when all previously open connections have closed.
ByteBuffers on line endings.
ByteBuffers by a fixed number of bytes.
ByteBuffers by a number of bytes specified in a fixed length header contained within the buffer.
LengthFieldPrependerPrepends the number of bytes to outgoing
ByteBuffers as a fixed length header. Can be used in a codec pair with the
RequestResponseHandlerMatches a request and a promise with the corresponding response.
HTTPResponseCompressorCompresses the body of every HTTP/1 response message.
DebugInboundsEventHandlerPrints out all inbound events that travel through the
DebugOutboundsEventHandlerPrints out all outbound events that travel through the
.pcapcontaining the traffic of the
ChannelPipelinethat you can inspect with Wireshark/tcpdump.
You may find interesting
SwiftNIO Extras 1.6.0 - 2020-07-29 09:11:43
- Support decompression of HTTP responses that do not contain a Content Length header (#93, patch credit to @fabianfett)
- Support in-memory PCAP capture (#94)
- Ensures gzip/deflate-compressed responses are properly finalized in all cases (#100, patch credit to @gkaindl)
- Link swift-nio-extras in docs (#87)
- Update build_podspec.sh to not use exact dependency versions (#91)
- Silence #file warnings (#96, #97)
- Don't install jazzy on xenial (#95)
SwiftNIO Extras 1.5.1 - 2020-05-19 10:53:38
- WritePCAPHandler: support logging more than 4GiB of data in one
Channelwithout crash (#85)
SwiftNIO Extras 1.5.0 - 2020-05-12 16:02:43
NIOHTTPRequestCompressorfor compressing HTTP requests. (#88) (Patch credit to @adam-fowler)
- Improved the tests. (#84) (Patch credit to @shekhar-rajak)
- Improved docker definitions. (#77, #86)
- Fixed some typos. (#82)
- Cleaned up the header sanity checking script. (#89)
- Added a documentation generation script. (#80)
SwiftNIO Extras 1.4.1 - 2020-05-02 08:40:41
- SECURITY: CVE-2020-9840
/GHSA-xhhr-p2r9-jmm7: Fix incorrect checking of the
.sizedecompression limit (report & patch credit @adtrevor)
SwiftNIO Extras 1.4.0 - 2020-01-22 16:25:22
- NIOWritePCAPHandler: make pcap issuing configurable (#75)
- Add syntax highlighting to installation steps (#76, patch credit to @trevorah)
- WritePCAPHandler: write outbound data on flush not write (#74)
- Update Code of Conduct project maintainer email address (#73)
SwiftNIO Extras 1.3.2 - 2019-11-14 11:11:14
- Added thread sanitiser testing to CI, patch credit to @tkrajacic. (#68)
- Added API checking validation, patch credit to @tkrajacic. (#69)
- Cleaned up CI docker files, patch credit to @tkrajacic. (#70)
- Improved internal code style. (#62, #72)
- Improved CI harness. (#63, #66, #67)
SwiftNIO Extras 1.3.1 - 2019-10-24 00:27:24
- Updated NIO dependency to require 2.9.0 and fixed build warnings. (#61)
SwiftNIO Extras 1.3.0 - 2019-10-16 20:34:22
- add HTTP server request decompression support (#59, patch credit @calebkleveter)
- extract common classes for server request decompressor (#60, patch credit @artemredkin)
- add HTTP client response decompression support (#56, patch credit @artemredkin)
- ServerQuiescingHelper: don't swallow close errors (#54)
- update conduct email group (#55)
SwiftNIO Extras 1.2.0 - 2019-07-22 16:59:43
- Added support for Content-Length based framing for JSON-RPC. (#53)
- Fixed issue where
LineBasedFrameDecoderwould not break correctly when receiving
- Added podspec. (#48, #50)
- Cleaned up README. (#47)
- Testing improvements. (#52)
SwiftNIO Extras 1.1.0 - 2019-07-22 16:56:56
- Added the
NIOWritePCAPHandlerfor synthesised packet captures. (#46)
- Miscellaneous repo cleanups. (#42, #43)
swift-nio-extras 1.0.0 - 2019-04-01 16:03:44
See our blog post announcing the release of the SwiftNIO 2 family.
swift-nio-extras 0.1.2 - 2018-09-12 11:44:48
This release contains no code changes, and is exists purely for administrative purposes.
swift-nio-extras 0.1.1 - 2018-08-15 15:49:26
- adds a line-based frame decoder that can split received buffers on line endings (#11)