• Stars
    star
    449
  • Rank 97,328 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

HTTP Implementation for Swift on Linux and Mac OS X

Swift HTTP Server

Simple HTTP implementation for Swift using POSIX socket API. Running on Mac OS X and Linux.

For Mac users: You can install new Swift compiler following this instruction then you will be able to build the code directly on your Xcode.

Compile

Run the following command to compile the source:

swift build

Run

After successfully compile, run the server with:

.build/debug/example

Now, go to http://localhost:8080 to test, the response should be: Hello World


Setting up Docker container from Dockerfile

Go to docker folder and run build.sh to build swiftbox image

cd docker
./build.sh

Run new container from swiftbox image, mount your working directory and expose the port:

docker run -it -p 8080:8080 -v /path/to/your/host/working/folder:/src swiftbox

Now you can go to /src folder, which linked to your /path/to/your/host/working/folder to start using:

cd /src
swift build

Setting up Docker container for Swift yourself

Create new ubuntu container, don't forget to expose port 8080 or whatever you want, to test the HTTP server

docker run -it -p 8080:8080 -v /path/to/your/host/working/folder:/src ubuntu

When you're in the new created ubuntu container, install some dependencies with apt-get:

apt-get update && apt-get install wget build-essential clang rsync libpython-all-dev libedit-dev libicu52 libxml2-dev

Now, download the latest Swift release for Linux:

wget https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-10-a/swift-2.2-SNAPSHOT-2015-12-10-a-ubuntu14.04.tar.gz

Extract the downloaded zip:

tar xzf swift-2.2-SNAPSHOT-2015-12-10-a-ubuntu14.04.tar.gz

Use rsync to move all the packages to your /usr folder:

rsync -a -v swift-2.2-SNAPSHOT-2015-12-10-a-ubuntu14.04/usr/ /usr

You can delete the downloaded files (optional):

rm -rf swift-2.2-SNAPSHOT-2015-12-10-a-ubuntu14.04*

Now, you have Swift installed, test it with the following command:

swift --version

License

The source code is published under MIT license. Please see LICENSE.md for more detail.

More Repositories

1

kanban-app

Kanban board built with Rust and Elm
Rust
1,774
star
2

pomoday-v2

A keyboard only task management web app
TypeScript
585
star
3

kanelm

Kanban board built with Elm
Elm
296
star
4

ascii-d

A cross-platform ASCII diagram drawing app https://web.ascii-draw.com
Rust
268
star
5

goxkey

Bα»™ gΓ΅ tiαΊΏng Việt khΓ΄ng cΓ³ chα»©c nΔƒng gΓ¬ ngoΓ i gΓ΅ tiαΊΏng Việt...
Rust
239
star
6

azeroth-js

🍺 Yet another Static blog engine. Built with ❀️ for Github
CSS
215
star
7

playgo

πŸ‘» a real playful Golang Playground
Go
184
star
8

node-online-game-template

JavaScript
176
star
9

sequencegenius

Transform your idea to diagrams. With AI, of course, it's 2023. https://sequencegenius.com/
TypeScript
124
star
10

dev.env

πŸ‘» Zero Setup Development Environment without Docker or Vagrant
Shell
116
star
11

node-js-game-server

Easy to use Multiplayer Game Server based on Node.JS. Suitable with HTML5 Websocket, Unity3D (Web/PC, Android, iOS,...), Flash, C++/OpenGL/DirectX, XNA clients,...
JavaScript
104
star
12

haskplex-font

103
star
13

js-playground

A JS playground with some decent visualization
TypeScript
99
star
14

codedaily-v3

Rust
87
star
15

vim-config

Vim Script
84
star
16

rust-webapp-template

Template project for Rust web app
Rust
67
star
17

ristretto-rs

β˜•οΈ the absolute perfect espresso
CSS
63
star
18

taskedit

πŸ“ an online notepad that only support markdown... lol
JavaScript
59
star
19

lichess-tv

Watch live chess from your terminal
C
57
star
20

hackernews-rss-reader

Read HackerNews's RSS feed
Rust
55
star
21

stackoverlazy

StackOverflow in your terminal
Go
54
star
22

everyday

Trying to write about what I learned everyday
JavaScript
54
star
23

code-playground

An online code playground that supports C++, Python, JavaScript and Rust
TypeScript
50
star
24

OctoCmd

πŸ™ Do more on Mac, efficiently!
Swift
47
star
25

angularjs-markdown-editor

Fully working Markdown Editor written in AngularJS
JavaScript
41
star
26

datatify

Simple single class used to display network status change notification (switch between WIFI, 3G and No connection)
Objective-C
37
star
27

snarkyed

GPU rendered text editor written in Rust
Rust
36
star
28

comby-search

A code search tool based on Comby
Rust
36
star
29

gitq

JavaScript
36
star
30

txtask

Ask Ollama about your local text files
Rust
34
star
31

adb.py

Tiny Python lib to write your own debug script for Android application with ADB
Python
32
star
32

xaudio

TypeScript
32
star
33

snackymini-keyboard

Snackymini Keyboard
C++
29
star
34

markto

Awesome notepad replacement with Markdown support for your Mac
JavaScript
26
star
35

nodben

Benchmark tool for any running process for Mac - Written in NodeJS
JavaScript
25
star
36

tab-list-arc-browser

Tab List extension for Arc Browser
JavaScript
25
star
37

speech

A tool to practice English speaking
Vue
24
star
38

coffee-now

β˜• CoffeeScript Playground
CoffeeScript
24
star
39

golang-checklist

A checklist to learn Golang
24
star
40

vscode-nord-light

23
star
41

slack-save-plugin

Save any Slack messages
JavaScript
23
star
42

helix-ui

Rust
22
star
43

actix-taskqueue

Rust
21
star
44

vim-espresso-tutti

Vim Script
21
star
45

productivity-watcher

Swift
19
star
46

mini-searcher

A dead simple search engine for static site blogs
Rust
19
star
47

vscode-tokyo-city

18
star
48

huy.rocks

My personal site
TypeScript
18
star
49

xaudio-cli

TUI Youtube Player using Elm Architecture and mpv JSON IPC
Rust
18
star
50

org-journal-list

A package to display a list of org-notes with preview.
Emacs Lisp
17
star
51

arduino-flappybird

Flappy Bird on Arduino
C++
17
star
52

vscode-github-light-monochrome

16
star
53

electron-typescript-react-tailwind-parcel

A template for making desktop app with cool technologies
JavaScript
16
star
54

opencl-benchmark

Sample program to compare calculation performance between CPU and GPU
C
16
star
55

lit

πŸ”₯ lit is an experimental WebSocket game server based on Engine.IO
JavaScript
16
star
56

vimouse-rs

Use keyboard to control your mouse
Rust
16
star
57

highl.it

Highlighter anywhere
JavaScript
15
star
58

csn-search

Search for music album on old.chiasenhac.vn
Haskell
15
star
59

trello-rs

Trello on your terminal
Rust
14
star
60

jsondb-rs

A RESTful JSON storage service
Rust
14
star
61

object-model

πŸ™ object-model is a tiny package that help you use any object as a Model.
JavaScript
14
star
62

js-chip8-emulator

Chip 8 Emulator - Experimental
JavaScript
14
star
63

rcat

Colorized cat written in Rust
Rust
14
star
64

pure-js-vote

πŸ” Yet another hamburger...
HTML
13
star
65

vscode-forest-all-nighter

13
star
66

skimGPT

Too lazy to read the full article? Skim it
Rust
12
star
67

dungeon-generator

TypeScript
12
star
68

clinews

News reader for hackers, geek, and command-line fanatics =]]
Python
12
star
69

roboplex-font

11
star
70

stocktable

Quick and extendable stock comparision tool
TypeScript
11
star
71

scrollreading

An extension to help you read better
JavaScript
11
star
72

makefile-boilerplate

🐀 A boilerplate for any-language-projects using Makefile.
Makefile
11
star
73

tradingview-mac-rs

Unofficial TradingView Desktop App
Rust
11
star
74

manga-frame-detect-opencv

Detect frames in a Manga page with OpenCV
Jupyter Notebook
10
star
75

highlightjs-focus

Line focus plugin for Highlight.js
TypeScript
10
star
76

web-debugger

TypeScript
10
star
77

firefox-safari

My attempt to make Firefox as compact as Safari
CSS
10
star
78

snacky-news-rs

Rust
9
star
79

gust-lang

It's not Go, it's not Rust, it's Gust
Rust
9
star
80

use

Things I use
9
star
81

crogue

A WIP roguelike game
C
9
star
82

lemontree-dark-vscode

9
star
83

slack-message-deleter

Delete Slack message from any channel using Slack's Web API
JavaScript
9
star
84

bubble-sort-visualized

Visualized Bubble Sort Algorithm
C
9
star
85

react-stackoverflow-flair

🎨 your own StackOverflow flair
JavaScript
8
star
86

nextjs-tailwind-typescript

JavaScript
8
star
87

idea-cli

Command-line based tool for task management
JavaScript
8
star
88

json-grep

Rust
8
star
89

kip

Kipalog CLI tool
Ruby
7
star
90

vim-nord-light-brighter

Vim Script
7
star
91

source-reading

A collection of source code reading notes
7
star
92

lit-demo

Demo game made with lit
JavaScript
6
star
93

typescript-react-template

JavaScript
6
star
94

bookmarks

HTML
6
star
95

Sizzular

Sizzle (jQuery Selector) + AngularJS Starter Code for any website
HTML
6
star
96

emacs-config

Emacs Lisp
6
star
97

chrome-json-formatter

JSON Formatter for Google Chrome
JavaScript
6
star
98

dotfiles

My dotfiles, feel free to use, feel no to blame
Shell
6
star
99

poloniex-cli

Poloniex Command Line
JavaScript
6
star
100

sergaem

WebSocket Multiplayer Game Server in Rust
Rust
6
star