Swiftpack.co - Package - IBM-Swift/Kitura-net

Kitura

APIDoc Build Status - Master macOS Linux Apache 2 Slack Status

Kitura-Net

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.

Kitura-net utilises the BlueSocket framework, the BlueSSLService framework and CCurl.

Features

  • Port Listening
  • FastCGI Server support
  • HTTP Server support (request and response)

Usage

Add dependencies

Add the Kitura-net package to the dependencies within your application’s Package.swift file. Substitute "x.x.x" with the latest Kitura-net release.

.package(url: "https://github.com/IBM-Swift/Kitura-net.git", from: "x.x.x")

Add KituraNet to your target's dependencies:

.target(name: "example", dependencies: ["KituraNet"]),

Import package

import KituraNet

Contributing to Kitura-net

All improvements to Kitura-net are very welcome! Here's how to get started with developing Kitura-net itself.

  1. Clone this repository.

$ git clone https://github.com/IBM-Swift/Kitura-net && cd Kitura-net

  1. Build and run tests.

$ swift test

You can find more info on contributing to Kitura in our contributing guidelines.

API Documentation

For more information visit our API reference.

Community

We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.

Github

link
Stars: 93

Used By

Total: 0

Releases

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 Expect header (#294): prevents ClientRequest (which uses curl) from sending an Expect: 100-continue header 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 ClientRequest.delegate (#278)

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

  • Add class property 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 HEAD requests with non-zero Content-Length (#225)
  • Prevent collision on HTTPParser state 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

What's New

  • 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

IBM-Swift/Kitura#1034

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

1.7.7 - 2017-06-01 19:41:51

v0.18.0 - 2016-06-20 20:19:38

- 2016-06-02 19:20:25

- 2016-05-09 16:38:02

v0.10.0 - 2016-04-25 14:37:21

v0.8.0 - 2016-04-11 22:13:40

v0.6.0 - 2016-03-23 20:10:18

v0.4.1 - 2016-03-15 21:53:39

v0.4.0 - 2016-03-08 23:33:15