Changes for version 0.001017 - 2026-02-11

  • New Features
    • HTTP/2 support (experimental). Requires Net::HTTP2::nghttp2. Enable with --http2 flag. Supports ALPN negotiation (h2/http1.1 over TLS), cleartext h2c via connection preface detection, WebSocket over HTTP/2 (RFC 8441), streaming responses with backpressure, and configurable protocol settings (h2_max_concurrent_streams, h2_initial_window_size, etc.)
    • Worker heartbeat monitoring for multi-worker mode. Parent process detects workers with blocked event loops via Unix pipe heartbeat and replaces them with SIGKILL + respawn. Default 50s timeout (heartbeat_timeout option, --heartbeat-timeout CLI flag). Only detects event loop starvation — async handlers using await are unaffected regardless of duration.
    • Custom access log format strings (--access-log-format). Supports atoms like %a (address), %s (status), %D (duration μs), %b (body size). Enables structured JSON logging via format string.
    • Track response body size in access log (%b atom)
  • Bug Fixes
    • Fix TLS performance cliff at 8+ concurrent connections caused by per-connection SSL context creation parsing the entire CA bundle. Shared SSL context via SSL_reuse_ctx gives ~26x throughput improvement.
    • Fix TLS in multi-worker mode — workers now SSL-upgrade connections in on_stream rather than relying on listener-level TLS
    • Fix SSE wire format to handle CRLF, LF, and bare CR line endings per the SSE specification
    • Fix multi-worker shutdown escalation — SIGKILL timer now fires correctly when workers don't exit after SIGTERM
    • Fix multi-worker parameter pass-through for server options
    • Fix flaky multi-worker TLS test
  • Improvements
    • Add on_ssl_error callback to TLS listener setup for cleaner error handling (suppresses "EV: error in callback" noise)
    • Cache Server header string to avoid per-response interpolation
    • Merge double header loop in serialize_response_start
    • Cache access log timestamp at per-second granularity
    • Cache client_host in access log to avoid per-request getpeername syscall
    • Skip HTTP/2 tests when Net::HTTP2::nghttp2 is not installed
    • Skip SSE tests when Future::IO is not installed
    • Remove unused Sys::Sendfile recommendation from cpanfile

Documentation

PAGI application server
Recipes for Common PAGI Tasks
HTTP/1.1, HTTP/2, WebSocket, and Security Compliance Documentation
PAGI Specification Documentation
PAGI Specification Documentation
PAGI Specification Documentation
PAGI Specification Documentation
A comprehensive guide to building async web applications with PAGI

Modules

Perl Asynchronous Gateway Interface
Try apps in sequence until success
Serve files with directory listing
Serve static files
Health check endpoint app
Load PAGI app from file
Customizable 404 response
HTTP reverse proxy (DEMO ONLY - NOT FOR PRODUCTION)
URL redirect app
Unified routing for HTTP, WebSocket, and SSE
Pub/sub Server-Sent Events
Rate-limited request processing
Mount apps at URL path prefixes
Pub/sub WebSocket broadcast
Multi-room chat application
Echo WebSocket messages back to sender
Execute CGI scripts as PAGI apps
PSGI-to-PAGI adapter
Class-based HTTP endpoint handler
Class-based router with wrapped handlers
Class-based Server-Sent Events endpoint handler
Class-based WebSocket endpoint handler
Wrap a PAGI app with lifecycle management
Base class for PAGI middleware
Request logging middleware
HTTP Basic Authentication middleware
Bearer token authentication middleware
DSL for composing PAGI middleware
Cross-Origin Resource Sharing middleware
Cross-Site Request Forgery protection middleware
Conditional GET/HEAD request handling
Auto Content-Length header middleware
HTTP content negotiation middleware
Cookie parsing middleware
Development debug panel middleware
ETag generation middleware
Exception handling middleware
Form request body parsing middleware
Response compression middleware
Force HTTPS redirect middleware
HEAD request handling middleware
Health check endpoint middleware
JSON request body parsing middleware
Validate PAGI application compliance
Serve maintenance page when enabled
Override HTTP method from request data
Request rate limiting middleware
Unique request ID middleware
Handle X-Forwarded-* headers from reverse proxies
URL rewriting middleware
Request timing middleware
Add retry hints to SSE events
Security headers middleware
Session management middleware
Static file serving middleware
Host header validation middleware
WebSocket per-message compression
Rate limiting for WebSocket connections
Delegate file serving to reverse proxy
Convenience wrapper for PAGI request scope
Streaming body consumption for PAGI requests
Async multipart/form-data parser
Content negotiation utilities for PAGI
Uploaded file representation
Fluent response builder for PAGI applications
PAGI application loader and server runner
Convenience wrapper for PAGI Server-Sent Events connections
PAGI Reference Server Implementation
Non-blocking file I/O for PAGI::Server internals
Per-connection state machine
Connection state tracking for HTTP requests
Dev-mode event field validation
HTTP/1.1 protocol handler
HTTP/2 protocol handler using nghttp2
Test client for PAGI applications
HTTP response wrapper for testing
Server-Sent Events connection for testing PAGI applications
WebSocket connection for testing PAGI applications
Shared utility helpers for PAGI
Convenience wrapper for PAGI WebSocket connections

Provides

in lib/PAGI/App/WrapPSGI.pm
in lib/PAGI/Endpoint/Router.pm
in lib/PAGI/Middleware/Cookie.pm
in lib/PAGI/Response.pm
in lib/PAGI/Server/Protocol/HTTP2.pm

Examples