{"id":1979,"url":"https://github.com/huytd/swift-http","last_synced_at":"2025-07-31T00:12:11.375Z","repository":{"id":148460360,"uuid":"47392572","full_name":"huytd/swift-http","owner":"huytd","description":"HTTP Implementation for Swift on Linux and Mac OS X","archived":false,"fork":false,"pushed_at":"2018-12-29T17:33:38.000Z","size":20,"stargazers_count":449,"open_issues_count":1,"forks_count":32,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-12-05T06:34:04.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huytd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-12-04T08:54:24.000Z","updated_at":"2024-08-25T22:50:23.000Z","dependencies_parsed_at":"2023-07-02T18:15:58.170Z","dependency_job_id":null,"html_url":"https://github.com/huytd/swift-http","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/huytd/swift-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huytd%2Fswift-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huytd%2Fswift-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huytd%2Fswift-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huytd%2Fswift-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huytd","download_url":"https://codeload.github.com/huytd/swift-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huytd%2Fswift-http/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267963638,"owners_count":24172885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:00.404Z","updated_at":"2025-07-31T00:12:11.342Z","avatar_url":"https://github.com/huytd.png","language":"Swift","funding_links":[],"categories":["Server"],"sub_categories":["Keychain","Other free courses"],"readme":"# Swift HTTP Server\n\nSimple HTTP implementation for Swift using POSIX socket API. Running on **Mac OS X** and **Linux**.\n\n**For Mac users:** You can install new Swift compiler following [this instruction](https://swift.org/download/#apple-platforms) then you will be able to build the code directly on your Xcode.\n\n## Compile\n\nRun the following command to compile the source:\n\n```\nswift build\n```\n\n## Run\n\nAfter successfully compile, run the server with:\n\n```\n.build/debug/example\n```\n\nNow, go to [http://localhost:8080](http://localhost:8080) to test, the response should be: `Hello World`\n\n---\n\n# Setting up Docker container from Dockerfile\n\nGo to `docker` folder and run `build.sh` to build `swiftbox` image\n\n```\ncd docker\n./build.sh\n```\n\nRun new container from `swiftbox` image, mount your working directory and expose the port:\n\n```\ndocker run -it -p 8080:8080 -v /path/to/your/host/working/folder:/src swiftbox\n```\n\nNow you can go to `/src` folder, which linked to your `/path/to/your/host/working/folder` to start using:\n\n```\ncd /src\nswift build\n```\n\n# Setting up Docker container for Swift yourself\n\nCreate new `ubuntu` container, don't forget to expose port `8080` or whatever you want, to test the HTTP server\n\n```\ndocker run -it -p 8080:8080 -v /path/to/your/host/working/folder:/src ubuntu\n```\n\nWhen you're in the new created `ubuntu` container, install some dependencies with `apt-get`:\n\n```\napt-get update \u0026\u0026 apt-get install wget build-essential clang rsync libpython-all-dev libedit-dev libicu52 libxml2-dev\n```\n\nNow, download the latest Swift release for Linux:\n\n```\nwget 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\n```\n\nExtract the downloaded `zip`:\n\n```\ntar xzf swift-2.2-SNAPSHOT-2015-12-10-a-ubuntu14.04.tar.gz\n```\n\nUse `rsync` to move all the packages to your `/usr` folder:\n\n```\nrsync -a -v swift-2.2-SNAPSHOT-2015-12-10-a-ubuntu14.04/usr/ /usr\n```\n\nYou can delete the downloaded files (optional):\n\n```\nrm -rf swift-2.2-SNAPSHOT-2015-12-10-a-ubuntu14.04*\n```\n\nNow, you have Swift installed, test it with the following command:\n\n```\nswift --version\n```\n\n# License\n\nThe source code is published under MIT license. Please see [`LICENSE.md`](LICENSE.md) for more detail.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuytd%2Fswift-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuytd%2Fswift-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuytd%2Fswift-http/lists"}