Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. Embassy

Embassy

MITSwiftv4.1.6

A super lightweight, zero-dependency async HTTP server library written in pure Swift for iOS, macOS, and Linux.

GitHubGitHub
619 stars72 forks0 contributors

What is Embassy?

Embassy is a super lightweight, asynchronous HTTP server library written entirely in Swift. It allows developers to embed a web server directly within Swift applications, enabling scenarios like UI testing, API mocking, or building simple web interfaces without external dependencies. The library uses an event loop architecture and supports the SWSGI interface for flexible web application development.

Target Audience

Swift developers building iOS, macOS, or Linux applications who need an embedded HTTP server for testing, mocking, or lightweight web services. It's particularly useful for mobile developers requiring local server capabilities within their apps.

Value Proposition

Developers choose Embassy for its minimal footprint, zero dependencies, and pure Swift implementation, making it easy to integrate and customize. Its async event loop and SWSGI support provide flexibility for advanced HTTP handling without the complexity of larger server frameworks.

Overview

Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux

Use Cases

Best For

  • Embedding a web server in iOS apps for UI testing
  • Mocking backend APIs during mobile development
  • Building lightweight internal admin interfaces for Swift applications
  • Creating simple web services for macOS or Linux using Swift
  • Implementing long-polling or delayed response scenarios in Swift
  • Developing educational or prototype web servers in pure Swift

Not Ideal For

  • Production web services requiring built-in security features like HTTPS and authentication
  • Teams needing a full-stack framework with routing, templating, and database integration out of the box
  • Applications demanding high-performance, concurrent request handling with minimal latency

Pros & Cons

Pros

Pure Swift Implementation

Written entirely in Swift with zero third-party dependencies, making it lightweight and easy to integrate into any Swift project without external bloat.

Cross-Platform Compatibility

Supports iOS, tvOS, macOS, and Linux, allowing developers to use the same server code across Apple and server environments.

Async Event Loop Architecture

Uses an asynchronous event loop that enables advanced HTTP handling such as long-polling, delays, and bandwidth throttling, ideal for testing and mocking scenarios.

SWSGI Interface Flexibility

Implements the Swift Web Server Gateway Interface, separating server logic from application code for modular and customizable web app development.

Cons

Thread Safety Limitations

Functions must be called within the same thread as the event loop, and using GCD for delays is discouraged, which can be restrictive for developers accustomed to concurrent programming patterns.

Minimal Feature Set

Lacks built-in features like routing, middleware, or templating, requiring manual implementation for common web development tasks.

Setup Complexity

Requires manual configuration of event loops and server instances, which can be more involved compared to higher-level frameworks that abstract these details.

Frequently Asked Questions

Quick Stats

Stars619
Forks72
Contributors0
Open Issues24
Last commit1 year ago
CreatedSince 2016

Tags

#http-server#ios#webserver#lightweight#asynchronous#async-io#linux#swift#event-loop#embedded-server#macos

Built With

S
Swift

Included in

iOS51.7kSwift26.0k
Auto-fetched 8 hours ago

Related Projects

VaporVapor

💧 A server-side Swift HTTP web framework.

Stars26,192
Forks1,525
Last commit12 hours ago
PerfectPerfect

Legacy Perfect - Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Stars13,740
Forks926
Last commit2 years ago
KituraKitura

A Swift web framework and HTTP server.

Stars7,578
Forks497
Last commit3 months ago
KituraKitura

A Swift web framework and HTTP server.

Stars7,578
Forks497
Last commit3 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub