A ASGI Server based on Hyper libraries and inspired by Gunicorn
Project description
Hypercorn is an ASGI and WSGI web server based on the sans-io hyper, h11, h2, and wsproto libraries and inspired by Gunicorn. Hypercorn supports HTTP/1, HTTP/2, WebSockets (over HTTP/1 and HTTP/2), ASGI, and WSGI specifications. Hypercorn can utilise asyncio, uvloop, or trio worker types.
Hypercorn can optionally serve the current draft of the HTTP/3 specification using the aioquic library. To enable this install the h3 optional extra, pip install hypercorn[h3] and then choose a quic binding e.g. hypercorn --quic-bind localhost:4433 ....
Hypercorn was initially part of Quart before being separated out into a standalone server. Hypercorn forked from version 0.5.0 of Quart.
Quickstart
Hypercorn can be installed via pip,
$ pip install hypercorn
and requires Python 3.8 or higher.
With hypercorn installed ASGI frameworks (or apps) can be served via Hypercorn via the command line,
$ hypercorn module:app
Alternatively Hypercorn can be used programatically,
import asyncio
from hypercorn.config import Config
from hypercorn.asyncio import serve
from module import app
asyncio.run(serve(app, Config()))
learn more (including a Trio example of the above) in the API usage docs.
Contributing
Hypercorn is developed on Github. If you come across an issue, or have a feature request please open an issue. If you want to contribute a fix or the feature-implementation please do (typo fixes welcome), by proposing a pull request.
Testing
The best way to test Hypercorn is with Tox,
$ pipenv install tox
$ tox
this will check the code style and run the tests.
Help
The Hypercorn documentation is the best place to start, after that try searching stack overflow, if you still can’t find an answer please open an issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hypercorn-0.17.3.tar.gz
.
File metadata
- Download URL: hypercorn-0.17.3.tar.gz
- Upload date:
- Size: 44.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b37802ee3ac52d2d85270700d565787ab16cf19e1462ccfa9f089ca17574165 |
|
MD5 | eb68a3ef49ce2bb262cdd2db0e0bb15d |
|
BLAKE2b-256 | 7e3adf6c27642e0dcb7aff688ca4be982f0fb5d89f2afd3096dc75347c16140f |
File details
Details for the file hypercorn-0.17.3-py3-none-any.whl
.
File metadata
- Download URL: hypercorn-0.17.3-py3-none-any.whl
- Upload date:
- Size: 61.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 059215dec34537f9d40a69258d323f56344805efb462959e727152b0aa504547 |
|
MD5 | 4fa41d2791bf475d1132736fe341204f |
|
BLAKE2b-256 | 0e3bdfa13a8d96aa24e40ea74a975a9906cfdc2ab2f4e3b498862a57052f04eb |