A simple HTTP server written in Swift

Overview

http4swift

http4swift is a tiny HTTP server library for Nest-compatible applications.

This project is unstable, and the API might be changed at anytime before we reach a stable version.

Usage

import http4swift
import Nest

let app: Application = { (request) -> ResponseType in
    // ...
}

guard let server = HTTPServer(port: 8080) else {
    fatalError()
}

server.serve(app)

Versions

  • v0.3.x
    • Nest 0.3 compatibility
  • v0.2.x
    • Nest 0.2 compatibility
  • v0.1.x
    • First release
You might also like...
Http Request wrapper written in Swift

Net Net is a HttpRequest wrapper written in Swift Features GET, POST, PUT, DELETE method Powerful request params: nested params, number, string, dic,

ServiceData is an HTTP networking library written in Swift which can download different types of data.

ServiceData Package Description : ServiceData is an HTTP networking library written in Swift which can download different types of data. Features List

Simple asynchronous HTTP networking class for Swift

YYHRequest YYHRequest is a simple and lightweight class for loading asynchronous HTTP requests in Swift. Built on NSURLConnection and NSOperationQueue

Parsing Simple HTTP Headers for swift

HTTP Headers Parsing simple HTTP headers using pre-defined header descriptions. Examples: let response = HTTPURLRseponse(..., headers: [ "X-RateLi

QwikHttp is a robust, yet lightweight and simple to use HTTP networking library for iOS, tvOS and watchOS

QwikHttp is a robust, yet lightweight and simple to use HTTP networking library. It allows you to customize every aspect of your http requests within a single line of code, using a Builder style syntax to keep your code super clean.

A simple, lighweight library for making http requets in iOS

HttpKIT Super simple, super lighweight library for making http requets in IOS. It is a work in progress so PR's are definitelty welcome and highly enc

🤵🏽‍♀️ Janet — A thin HTTP networking layer built on URLSession for simple, declarative endpoint specification leveraging the power of async/await.

🤵🏽‍♀️ Janet — Just another networking kit — A thin HTTP networking layer built on URLSession for simple, declarative endpoint specification leveragi

Elegant HTTP Networking in Swift
Elegant HTTP Networking in Swift

Alamofire is an HTTP networking library written in Swift. Features Component Libraries Requirements Migration Guides Communication Installation Usage

Swift HTTP for Humans
Swift HTTP for Humans

Just is a client-side HTTP library inspired by python-requests - HTTP for Humans. Features Just lets you to the following effortlessly: URL queries cu

Comments
  • Build error on Ubuntu 15.05

    Build error on Ubuntu 15.05

    I ran swift build after cloning swiftra-example and got the following error:

    $ swift build
    Cloning Packages/swiftra
    Cloning Packages/http4swift
    Compiling Swift Module 'http4swift' (6 sources)
    /home/dan/Downloads/swiftra-example/Packages/http4swift-0.0.2/Sources/HTTPRequest.swift:87:40: error: value of type 'String' has no member 'hasPrefix'
                        if line.isEmpty || line.hasPrefix(String(HTTPRequestParser.CR)) {
                                           ^~~~ ~~~~~~~~~
    <unknown>:0: error: build had 1 command failures
    swift-build: exit(1): ["/usr/bin/swift-build-tool", "-f", "/home/dan/Downloads/swiftra-example/.build/debug/http4swift.o/llbuild.yaml"]
    
    opened by Danappelxx 2
  • Socket fixes

    Socket fixes

    This fixes a few sockets-related issues that I encountered while trying to deploy a Swiftra app.

    • Prevent crashes due to receiving SIGPIPE when writing to a connection that was closed by the other end
    • Try harder to ensure that all bytes get sent before closing the socket
    opened by briancroom 1
Owner
Shun Takebayashi
Shun Takebayashi
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Dec 31, 2022
Lightweight, flexible HTTP server framework written in Swift

Hummingbird Lightweight, flexible server framework written in Swift. Hummingbird consists of three main components, the core HTTP server, a minimal we

Hummingbird 245 Dec 30, 2022
Http - Demo for Http Layer

http Example To run the example project, clone the repo, and run pod install fro

null 0 Jan 24, 2022
A Swift web framework and HTTP server.

A Swift Web Framework and HTTP Server Summary Kitura is a web framework and web server that is created for web services written in Swift. For more inf

Kitura 7.6k Jan 6, 2023
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux

Embassy Super lightweight async HTTP server in pure Swift. Please read: Embedded web server for iOS UI testing. See also: Our lightweight web framewor

Envoy 540 Dec 15, 2022
Swift HTTP server using the pre-fork worker model

Curassow Curassow is a Swift Nest HTTP Server. It uses the pre-fork worker model and it's similar to Python's Gunicorn and Ruby's Unicorn. It exposes

Kyle Fuller Archive 397 Oct 30, 2022
libuv base Swift web HTTP server framework

Notice Trevi now open a Trevi Community. Yoseob/Trevi project split up into respective Trevi, lime, middlewares and sys packages at our community. If

leeyoseob 46 Jan 29, 2022
A very basic proof-of-concept Swift HTTP server that does not require Foundation

Swift Server Introduction This is very rough and basic HTTP server written in Swift without using Foundation. This is partially based on the Swifter r

Cezary Wojcik 55 Apr 27, 2022
FlyingFox - a lightweight HTTP server built using Swift Concurrency

Usage Credits Introduction FlyingFox is a lightweight HTTP server built using Swift Concurrency. The server uses non blocking BSD sockets, handling ea

Simon Whitty 262 Dec 24, 2022
Swift Express is a simple, yet unopinionated web application server written in Swift

Documentation <h5 align="right"><a href="http://demo.swiftexpress.io/">Live ?? server running Demo <img src="https://cdn0.iconfinder.com/data/icons/

Crossroad Labs 850 Dec 2, 2022