Echocorn is an exceptionally fast, lightweight ASGI server with a custom HTTP/1.1 implementation and first-class HTTP/2 support (powered by the h2 library). Designed for modern web applications, Echocorn combines high throughput with small resource overhead and includes built-in response compression and hardened HTTP header security.
Sometimes unstable. Do not use in production
- High-performance ASGI server optimized for low-latency workloads
- Native HTTP/1.1 implementation plus built-in HTTP/2 support via
h2 - Transparent response compression (gzip/deflate) to reduce bandwidth usage
- Enhanced HTTP header security (CSP, HSTS, X-Frame-Options, etc.) out of the box
- Minimal dependencies and small memory footprint
- Simple command-line interface for quick deployment
Install from PyPI:
pip install echocornRun your ASGI application (example using a callable named app inside app.py):
echocorn --app app:app --port 443Show all available command-line options:
echocorn --helpUse Echocorn to serve a FastAPI, Starlette, or any ASGI app.
# Serve app.app (where `app` is an ASGI application instance)
echocorn --app app:app --host 0.0.0.0 --port 443 --workers 2 --safe-headers --keyfile key.pem --certfile cert.pemEchocorn exposes CLI flags for common server settings such as:
--app— module:callable path to your ASGI application--host/--port— where the server listens--workers— number of worker processes--certfile,--keyfile— TLS/SSL files for secure connections--compression— toggle or tune response compression--safe-headers— enable security headers--domain— allows requests only if host in headers matches--about— show about the server
Run echocorn --help to see the full set of parameters and defaults.
Echocorn focuses on secure and efficient defaults:
- HTTP header hardening (CSP, HSTS, X-Content-Type-Options, X-Frame-Options) to reduce common web risks
- Built-in compression to reduce latency & bandwidth costs for clients
- Optimised request/response handling path for minimal overhead and maximum throughput
For production use, pair Echocorn with standard hardening measures (firewall rules, TLS best practices, OS-level tuning) and monitor resource usage.
Examples of running Echocorn and request logs:
If you find Echocorn useful and want to support development, you can donate here:
- Discord: https://discord.gg/xwpMuMYW57
If you find a bug or have questions, open an issue or reach out on Discord.