The Kitura-net module contains logic for sending and receiving HTTP requests. It also contains the structure for listening on a port and sending requests to a delegate for processing. It can be used to create HTTP/CGI servers on specific ports, and provides HTTP functionality.
We expect most of our users to require higher level concepts such as routing, templates and middleware, these are not provided in Kitura-net, if you want to use those facilities you should be coding at the Kitura level, for this please see the Kitura project. Kitura-net underpins Kitura which offers a higher abstraction level to users.
- Port Listening
- FastCGI Server support
- HTTP Server support (request and response)
Kitura-net package to the dependencies within your application’s
Package.swift file. Substitute
"x.x.x" with the latest
.package(url: "https://github.com/IBM-Swift/Kitura-net.git", from: "x.x.x")
KituraNet to your target's dependencies:
.target(name: "example", dependencies: ["KituraNet"]),
Contributing to Kitura-net
All improvements to Kitura-net are very welcome! Here's how to get started with developing Kitura-net itself.
- Clone this repository.
$ git clone https://github.com/IBM-Swift/Kitura-net && cd Kitura-net
- Build and run tests.
$ swift test
You can find more info on contributing to Kitura in our contributing guidelines.
For more information visit our API reference.
We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!
This library is licensed under Apache 2.0. Full license text is available in LICENSE.
You may find interesting
2.4.0 - 2019-10-08 15:00:03
- fix: Send Basic Auth credentials in an Authorization header (#303)
- feat: Ability to limit request size and connection count (#307)
2.3.0 - 2019-05-24 09:11:28
feat: Allow Kitura-NIO to only listen on one network address (#299). Kitura listens on every available address/interface. This feature allows Kitura to listen on only on interface/network address.
2.2.0 - 2019-04-03 19:06:30
- feat: Add support for Unix domain sockets (#296)
2.1.7 - 2019-03-05 16:26:50
- Disable curl's
Expectheader (#294): prevents ClientRequest (which uses curl) from sending an
Expect: 100-continueheader when sending payloads above a certain threshold, as Kitura does not support it (resulting in a 1 second delay for such requests).
2.1.5 - 2019-01-08 14:06:58
- fix: resolve crash on Linux with Swift 5 (#284)
2.1.4 - 2019-01-07 11:02:04
- fix: workaround to pass UInt16 value for ClientRequest.Options (#285) - resolves #275
2.1.3 - 2018-12-03 11:32:05
- fix: Ensure exclusive access (SE-0176) when mutating
2.1.2 - 2018-09-27 16:48:29
- Resolves compilation warnings with Swift 4.2 (#277)
2.1.1 - 2018-07-09 11:57:00
- Fixes for ClientRequest redirection behaviour (#270)
- http_parser upgrade (#272)
- Documentation improvements
2.1.0 - 2018-04-16 16:12:46
classproperty on HTTPStatusCode and Class enum, to enable querying of the class that a status code belongs to (#246, successor to #240)
- Update dependencies for Swift 4.1 (#250)
2.0.4 - 2018-02-26 10:28:00
- Support Swift 4.1 (#242)
2.0.2 - 2018-02-22 16:44:09
- Increase number of GCD read queues (#235)
v2.0.0 - 2017-11-17 15:15:43
Migrated repo to Swift 4.0.2.
1.7.20 - 2017-11-10 17:22:11
- Close Keep-Alive connections following a parser error (#232)
- Support HTTP Pipelining (#229)
1.7.19 - 2017-11-06 15:47:15
- Fix parsing of responses to
HEADrequests with non-zero
- Prevent collision on
HTTPParserstate by consecutive keepalive requests (#227)
1.7.18 - 2017-10-17 20:05:53
- Disable port reuse by default (#223)
- Allow PATCH requests to send data (#224)
1.7.17 - 2017-10-13 14:21:14
- Resolves issue IBM-Swift/Kitura#1143 (#219), where a misbehaved client connecting to an SSL listener could block further connection attempts from other clients.
1.7.16 - 2017-09-13 16:11:03
- Add support for Swift 4
- Allow the limit on consecutive Keep-Alive requests per connection to be configurable. The default has been changed to allow an unlimited number of requests.
Temporary workaround for a rare crash under load - 2017-07-25 15:49:03
Address Intermittent Crashes - 2017-07-18 19:06:43
Insure that the IncomingSocketProcessor used by an IncomingSocketHandler has the back link to the IncomingSocketHandler initialized before the ReaderSource is resumed.
Also removed an unneeded back link to the IncomingSocketManager.
1.7.13 - 2017-07-06 15:28:04
Fix crash in
IncomingSocketHandler as reported in Kitura/#1034
Tested on Swift 4 6/29 snapshot