Latest 2.1.0
License MIT
Platforms ios 8.0, osx 10.9, tvos 9.0
Dependencies Socket.swift

Platform Linux
Cocoapods Compatible
Build Status - Master

A tiny HTTP server engine written in swift.


  • SSL/TLS support
  • Error handling
  • Global middlewares
  • Route middlewares
  • Route grouping
  • File serving
  • Directory browsing
  • Request parameters
  • Works in Linux, iOS, macOS and tvOS
let server = Server()
server.get("/hello/{id}") { request in
    return .ok(request.routeParams["id"]!) 

try //go to http://localhost:8080/hello/1?state=active in the browser



CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate Http.swift into your Xcode project using CocoaPods, specify it in your Podfile:

source ''
target '<Your Target Name>' do
    pod 'Http.swift', '~> 2.1'

Then, run the following command:

$ pod install

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but Http.swift does support its use on supported platforms.

Once you have your Swift package set up, adding Http.swift as a dependency is as easy as adding it to the dependencies value of your Package.swift.

import PackageDescription

let package = Package(
    name: "MyServer",
    dependencies: [
        .Package(url: "", majorVersion: 2)


See also the list of contributors who participated in this project.


This project is licensed under the MIT License – see the LICENSE file for details

Latest podspec

    "name": "Http.swift",
    "version": "2.1.0",
    "summary": "A tiny http server engine written in swift.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Orkhan Alikhanov": "[email protected]"
    "source": {
        "git": "",
        "tag": "2.1.0"
    "module_name": "HttpSwift",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0"
    "source_files": "Sources/*.swift",
    "dependencies": {
        "Socket.swift": [
            "~> 2.2"

Pin It on Pinterest

Share This