Skip to main content

Echocorn

Fast, lightweight ASGI server with HTTP/1.1, HTTP/2 and WebSockets. For FastAPI, Starlette, Django, Quart and others.

Install

Python 3.11+:

pip install echocorn
pip install "echocorn[uvloop]"  # faster loop, no Windows

Quick start

echocorn.toml next to your app:

app = "app:app"  # or "127.0.0.1:5000" for proxy mode

[server]
host = "0.0.0.0"
port = 8000
workers = 4
echocorn --config echocorn.toml

Full example with comments: echocorn.toml.

Python API:

from echocorn import ASGIServer, ServerConfig
ASGIServer(app, ServerConfig(host="127.0.0.1", port=8080)).run()
# or: await server.serve()

Flask (WSGI) needs one line:

from asgiref.wsgi import WsgiToAsgi
app = WsgiToAsgi(app)

Features

  • HTTP/1.1 (keep-alive, chunked, 100-continue, trailers) and HTTP/2 (ALPN, h2c, flow control, GOAWAY).
  • WebSockets (ws/wss, subprotocols, ping/pong, fragmentation).
  • gzip/deflate, Vary: Accept-Encoding.
  • Strict framing (no smuggling), header injection protection, safe_headers, bind_domain.
  • Timeouts, limits, rate limiting (429 + Retry-After), graceful shutdown.
  • HTTP->HTTPS redirect and reverse-proxy mode (app = "127.0.0.1:5000").

Proxy example:

app = "127.0.0.1:5000"

[server]
port = 443

[tls]
certfile = "cert.pem"
keyfile = "key.pem"

[redirect]
enabled = true
port = 80

Only local upstreams allowed (127.0.0.0/8, 10/8, 192.168/16, ::1, ...). X-Forwarded-* is replaced, never appended.

CLI

usage: echocorn --config PATH
  --config PATH   config file (required)
  -h, --help
  --version
  --about

Production notes

  • TLS 1.2+, tune somaxconn, file descriptors, monitoring.
  • Set max_request_size, request_timeout, [ratelimit] for public services.

Metadata

Release files for echocorn 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for echocorn 1.0.5
File Size Uploaded
echocorn-1.0.5.tar.gz 102.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for echocorn 1.0.5
File Interpreter ABI Platform
echocorn-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 207.4 kB

Release files / echocorn-1.0.5.tar.gz

Download URL echocorn-1.0.5.tar.gz
Size 102.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8f7020f6840b730c74b4a190c5ed4c27d188b32cec85c77d78a02a01f946cfcf
BLAKE2b-256 checksum
How to use checksums
10304e51dd96ba98113c1d1252651f98813738d395f8eb7886a80771ec07d3b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / echocorn-1.0.5-py3-none-any.whl

Download URL echocorn-1.0.5-py3-none-any.whl
Size 104.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abe116b479084eedb55185716de64c33874e90e75e0db2c6db74c08ca267c9b4
BLAKE2b-256 checksum
How to use checksums
6be82f8122c95088004587c101278c4383abba5778b4568b313ec56523625137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page