Releases: swhitty/FlyingFox
Releases · swhitty/FlyingFox
SocketPool kqueue / epoll
kqueue(2)
/epoll(7)
events are now used to suspend and resume socket usingSocketPool<EventQueue>
SocketPool<EventQueue>
is now the default pool used byHTTPServer
PollingSocketPool
has been replaced bySocketPool<Poll>
- Windows uses
SocketPool<Poll>
- Moved
HTTPLogging
toFlyingSocks.Logging
enabling logs within sockets and pools. - Decreased compilation time
epoll Fix
Support for kqueue / epoll
- Gracefully finish existing requests then stop server with
await server.stop()
- Retrieve the server listening address with
await server.listeningAddress
- Use
makeEventQueuePool()
to enablekqueue(2)
on Darwin platforms andepoll(7)
on Linux. PollingSocketPool
remains the default socket pool.- Fixes WebSocket bug where connection would not be removed after disconnection.
- Fixes for Swift 5.7 related warnings
Swift 5.7 Support
- Support for building and testing with Swift 5.7 (Xcode 14 beta).
- CancellingContinuation ensures cancellation does not escape actor isolated methods.
- Updates default
PollingSocketPool
interval to not block the cooperative task pool at all.
0.7.0
import FlyingSocks
module exposes the underlying async sockets that power FlyingFoxHTTPServer
can be started with anyAsyncSocketPool
.PollingSocketPool
can be tuned to control the interval before and after each loop.- Improved concurrency checking support on Swift 5.6
- Experimental support for Windows 10
0.6.0
WebSocketHTTPHandler
enables support for WebSockets allowing handlers to exchange pair of AsyncStream.DirectoryHTTPHandler
to automatically share all files within a directory.- Groups
sockaddr
structures withprotocol SocketAddress
- Supports UNIX-domain sockets via
sockaddr_un
0.5.0
0.4.1
0.4.0
Several enhancements have been made to HTTPRoute
that enable fine grained pattern matching of requests.
Query items can now be matched:
await server.appendRoute("GET /meal?side=fish", to: .file(named: "meal-fish.json"))
await server.appendRoute("GET /meal?side=chips", to: .file(named: "meal-chips.json"))
HTTP headers can also be matched:
let json = HTTPRoute("*", headers: [.contentType: "application/json"])
let xml = HTTPRoute("*", headers: [.contentType: "application/xml"])
await server.appendRoute(json, to: .file(named: "sample.json"))
await server.appendRoute(xml, to: .file(named: "sample.xml"))
And request body can also be matched:
public protocol HTTPBodyPattern: Sendable {
func evaluate(_ body: Data) -> Bool
}
Darwin platforms can pattern match a JSON body with an NSPredicate
:
let route = HTTPRoute("POST *", body: .json(where: "food == 'fish'"))
{"side": "chips", "food": "fish"}