- Notifications
You must be signed in to change notification settings - Fork111
Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.
License
pgjones/hypercorn
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Hypercorn is anASGI andWSGI web server based on the sans-io hyper,h11,h2, andwsproto libraries and inspired byGunicorn. Hypercorn supports HTTP/1, HTTP/2, WebSockets (over HTTP/1and HTTP/2), ASGI, and WSGI specifications. Hypercorn can utiliseasyncio, uvloop, or trio worker types.
Hypercorn can optionally serve the current draft of the HTTP/3specification using theaioquic library. To enable this installtheh3
optional extra,pip install hypercorn[h3]
and thenchoose a quic binding e.g.hypercorn --quic-bind localhost:4433...
.
Hypercorn was initially part ofQuart before being separated out into astandalone server. Hypercorn forked from version 0.5.0 of Quart.
Hypercorn can be installed viapip,
$pip install hypercorn
and requires Python 3.8 or higher.
With hypercorn installed ASGI frameworks (or apps) can be served viaHypercorn via the command line,
$hypercorn module:app
Alternatively Hypercorn can be used programatically,
importasynciofromhypercorn.configimportConfigfromhypercorn.asyncioimportservefrommoduleimportappasyncio.run(serve(app,Config()))
learn more (including a Trio example of the above) in theAPI usagedocs.
Hypercorn is developed onGithub. If you come across an issue,or have a feature request please open anissue. If you want tocontribute a fix or the feature-implementation please do (typo fixeswelcome), by proposing apull request.
The best way to test Hypercorn is withTox,
$pipenv install tox$tox
this will check the code style and run the tests.
The Hypercorndocumentation isthe best place to start, after that try searching stack overflow, ifyou still can't find an answer pleaseopen an issue.
About
Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.