Zum Hauptinhalt springen
Plug logo

Plug

Compose web applications with functions

Plug is a specification and toolkit for composing web applications with functions in Elixir. It provides a unified interface for handling HTTP connections and is the foundational layer used by Phoenix and other Elixir frameworks for request handling, routing, and WebSocket support.

3K
GitHub Stars
medium
Learning Curve
4.0
DX Score

Preise

Model
free
Kostenlose Stufe
Free and open-source under Apache License 2.0.

Funktionen

  • Module and function plug patterns
  • Built-in Plug.Router for request dispatch
  • WebSocket support via connection upgrade API
  • Composable middleware pipeline
  • Extremely fast route lookups
  • Pre-built plugs for common tasks
  • CSRF protection and session management
  • SSL enforcement
  • Static file serving
  • Plug.Test for testing

Vorteile

  • + Framework-agnostic and lightweight
  • + Supports multiple web servers (Cowboy, Bandit)
  • + Immutable connection model for safe concurrency
  • + Direct access to streaming capabilities
  • + Foundation for Phoenix framework

Nachteile

  • - Requires external webserver dependency
  • - Steeper learning curve for non-Elixir developers
  • - Smaller ecosystem than Node.js alternatives
  • - Limited to BEAM/Elixir runtime

Am besten für

indie hacker startup

Alternativen

elixir erlang beam web middleware http websocket