Skip to content

Implementation of the ASGI application standard as a Twisted Resource

License

Notifications You must be signed in to change notification settings

JohnDoee/txasgiresource

Repository files navigation

txasgiresource

txasgiresource is ASGI implemented as a Twisted Web Resource, very similar to WSGIResource.

This is inspired by Daphne but somewhat implemented from specs.

It can also run as a daemon.

The code is available on GitHub

Usage

As Twisted Resource

from twisted.web import server

from yourdjangoproject.routing import application

resource = ASGIResource(application)
site = server.Site(resource)

# If we are done with the resource, make sure to stop it.

yield resource.stop()

As ASGI Protocol server

twistd -n txasgi -a yourdjangoproject.routing:application

As ASGI Protocol server on a different port and ip

twistd -n txasgi -a yourdjangoproject.asgi:channel_layer -d tcp:5566:interface=0.0.0.0

Supported specifications

Specification Supported
asgi2 Yes, through compatibility handler
asgi3 Yes
HTTP Yes, v2.0
Websocket Yes, v2.0
Lifespan No

Status

Master branch

https://coveralls.io/repos/github/JohnDoee/txasgiresource/badge.svg?branch=master https://travis-ci.org/JohnDoee/txasgiresource.svg?branch=master

Develop branch

https://coveralls.io/repos/github/JohnDoee/txasgiresource/badge.svg?branch=develop https://travis-ci.org/JohnDoee/txasgiresource.svg?branch=develop

License

MIT, see LICENSE

About

Implementation of the ASGI application standard as a Twisted Resource

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages