skillfed

daphne

Django ASGI (HTTP/WebSocket) server

daphne v4.2.3 6.0M downloads/30d#1,977 on PyPI2,679
Permissive license BSD Active released

What it is and what it does

Daphne is an ASGI server purpose-built for Django Channels that terminates HTTP, HTTP/2, and WebSocket connections. It automatically negotiates which protocol to use based on client requests, eliminating the need for URL-based routing to distinguish WebSocket from HTTP endpoints. The server is configured via command-line flags or Twisted endpoint description strings, supporting multiple binding modes: TCP ports, UNIX sockets, file descriptors passed from process managers, and TLS endpoints.

The package depends on asgiref, autobahn, and twisted. It supports Python 3.9 through 3.13 and is actively maintained as part of the Django Channels project. HTTP/2 support is available when Twisted's http2 and tls extras are installed and TLS is enabled; the server logs whether HTTP/2 support is active on startup. Daphne is typically deployed behind a reverse proxy for static file serving or as a standalone application server in containerized environments.

Use it for:

  • Running Django Channels applications that need to handle real-time WebSocket connections alongside standard HTTP requests.
  • Deploying ASGI applications with HTTP/2 support when TLS is enabled and modern OpenSSL is available.
  • Binding to UNIX sockets for inter-process communication with a reverse proxy or load balancer.
  • Using automatic TLS certificate provisioning via txacme endpoint syntax for Let's Encrypt integration.
  • Running inside process managers (systemd, supervisord) that pass file descriptors to the application.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Daphne is an ASGI server that handles HTTP, HTTP/2, and WebSocket protocols for Django Channels applications, with automatic protocol negotiation and support for multiple binding modes.

Yes. Daphne is the reference ASGI server for Django Channels with active maintenance, no known vulnerabilities, low install friction, and permissive licensing. Install it if you are building a Django Channels application or need an ASGI server with native WebSocket and HTTP/2 support. The only gotcha is the HTTP/2 requirement for OpenSSL 1.0.2+, which is standard on modern systems.

Install

daphne on PyPI

pip

pip install daphne

uv

uv add daphne

poetry

poetry add daphne

Installing daphne

Before you install

Low install friction with a pure-Python wheel. Actively maintained with a recent release (24 days ago) and 2679 repository stars. Requires Python 3.9 or later; HTTP/2 support needs Twisted's http2 and tls extras plus OpenSSL 1.0.2 or greater.

License in practice

BSD license (permissive) places no significant restrictions on use, modification, or distribution.

Quickstart

pip install daphne

# Point Daphne to your ASGI application:
daphne -b 0.0.0.0 -p 8001 django_project.asgi:application

# Or use a UNIX socket:
daphne -u /tmp/daphne.sock django_project.asgi:application

Requires Python 3.9 or later. HTTP/2 support requires OpenSSL 1.0.2 or greater and Twisted[tls,http2] installed separately.

Verify before relying

  • Performance characteristics and throughput capacity under load compared to other ASGI servers.
  • Whether automatic protocol negotiation works reliably across all client types and edge cases.
  • Production deployment best practices and recommended configurations for high-traffic scenarios.

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — asgiref, autobahn, twisted
Maintenance actively maintained — 24 days since the last release
Last repo commit
First released
Downloads 6,048,311/month — #1,977 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: daphne-4.2.3-py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP

Tags

ASGI server for DjangoHTTP WebSocket serverDjango Channels serverHTTP/2 protocol serverASGI application server
asgi-serverwebsocketdjango-channels

More WWW/HTTP packages