--- id: daphne version: "4.2.3" license: BSD license_treatment: permissive maintenance: active --- # daphne — Django ASGI (HTTP/WebSocket) server License: permissive · Maintenance: active · Downloads: 6.0M/mo ## 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 above — 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 pip install daphne uv add daphne 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_current - Install friction: low - Maintenance: active - Downloads: 6.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ASGI server for Django, HTTP WebSocket server, Django Channels server, HTTP/2 protocol server, ASGI application server, asgi-server, websocket, django-channels [View on SkillFed](https://skillfed.io/packages/daphne) · [View on PyPI](https://pypi.org/project/daphne/)