Kitura-NIO is a SwiftNIO based networking library for Kitura. Other than an additive change to the HTTPServer API around IPv6 support, Kitura-NIO adopts the same API as KituraNet, making the transition to using the NIO port almost seamless. While Kitura-NIO shares some code with Kitura-Net, the core comprising of HTTPServer, ClientRequest/ClientResponse and TLS support have been implemented using SwiftNIO.
We expect most of our users to require higher level concepts such as routing, templates and middleware, these are not provided in Kitura-NIO, if you want to use those facilities you should be coding at the Kitura level, for this please see the Kitura project. Kitura-NIO, like Kitura-net, underpins Kitura which offers a higher abstraction level to users.
As of today, Kitura-NIO has been tested with Swift 4.1 only.
- Port Listening
- HTTP Server support (request and response)
To test your Kitura app with the very eary version of the Kitura-NIO networking framework, all you need to do is point to the kitura-nio branch from your Package.swift:
dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/IBM-Swift/Kitura", .branch("kitura-nio")), ],
Kitura will then use Kitura-NIO instead of Kitura-net for, networking.
Visit www.kitura.io for reference documentation.
Contributing to Kitura-NIO
We'd be more than happy to receive bug reports, enhancement requests and pull requests!
- Clone this repository.
$ git clone https://github.com/IBM-Swift/Kitura-NIO && cd Kitura-NIO
- Set the open file limit to a large number. This is to work around an open issue.
$ ulimit -n 65536
- Build and run tests.
$ swift test
These are early days for Kitura-NIO. We'd really love to hear feedback from you.