hi all, i’m pleased to announce the initial public release of the swift-ip library — a portable, Foundation-free library for working with IP addresses.
Why use swift-ip?
The IP address types defined by the Network
framework are Darwin-only, which precludes their use in server-side code.
The swift-nio library provides a multi-platform SocketAddress
type, but it is heap-allocated and reference-counted, and requires linking against the entire NIOCore
module. This makes it unsuitable as a high-performance currency type for purposes such as firewall implementations or metrics collection.
Who is using swift-ip?
The Swiftinit documentation index currently uses the swift-ip library to verify clients (such as Googlebot and GitHub Webhooks) and combat abuse.
Requirements
The swift-ip library requires Swift 6.0 or later. This is because IP.V6
uses UInt128
.