Skip to main content

A ASGI Server based on Hyper libraries and inspired by Gunicorn

Project description

Hypercorn logo

Build Status docs pypi http python license

Anycorn is an ASGI and WSGI web server based on the sans-io hyper, h11, h2, and wsproto libraries and inspired by Gunicorn. Anycorn supports HTTP/1, HTTP/2, WebSockets (over HTTP/1 and HTTP/2), ASGI, and WSGI specifications. Anycorn utilises anyio worker types.

Anycorn 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 anycorn[h3] and then choose a quic binding e.g. anycorn --quic-bind localhost:4433 ....

Anycorn is a fork of Hypercorn that replaces asyncio where asyncio and Trio implementations are replaced with AnyIO. Anycorn forked from version 0.16.0 of Hypercorn.

Quickstart

Anycorn can be installed via pip,

$ pip install anycorn

and requires Python 3.8 or higher.

With anycorn installed ASGI frameworks (or apps) can be served via Anycorn via the command line,

$ anycorn module:app

Alternatively Anycorn can be used programatically,

import anyio
from anycorn.config import Config
from anycorn import serve

from module import app

anyio.run(serve, app, Config())

learn more in the API usage docs.

Contributing

Anycorn 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 Anycorn is with Tox,

$ pipenv install tox
$ tox

this will check the code style and run the tests.

Help

The Anycorn 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anycorn-0.16.0.tar.gz (37.2 kB view hashes)

Uploaded Source

Built Distribution

anycorn-0.16.0-py3-none-any.whl (49.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page