Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Http Server Laravel Package

amphp/http-server

Non-blocking, concurrent HTTP/1.1 and HTTP/2 application server for PHP 8.1+ built on Revolt and Amp (fibers). Includes TLS, middleware, gzip, and integrations for routing, static files, WebSockets, sessions, and more.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • High-Concurrency APIs & Real-Time Apps: Enables building scalable, non-blocking HTTP/1.1 and HTTP/2 APIs for applications requiring low-latency responses (e.g., chat apps, live dashboards, or IoT platforms).
  • WebSocket Integration: Supports real-time bidirectional communication (e.g., collaborative tools, gaming, or notifications) via the amphp/websocket-server package.
  • Microservices & Event-Driven Architecture: Ideal for decomposing monolithic apps into lightweight, concurrent services (e.g., async task queues, event sourcing).
  • Static Asset Serving: Reduces infrastructure complexity by offloading static files (e.g., images, JS/CSS) directly from PHP, cutting CDN costs for low-traffic assets.
  • Middleware & Modularity: Facilitates clean separation of concerns (e.g., auth, logging, rate-limiting) via composable middleware, aligning with modern PHP frameworks like Laravel but with async flexibility.
  • HTTP/2 Adoption: Future-proofs APIs for multiplexing, header compression, and server push, critical for performance-sensitive SPAs or mobile apps.
  • Build vs. Buy: Avoids reinventing async HTTP servers (e.g., Swoole, RoadRunner) while leveraging PHP’s native ecosystem (Composer, PSR standards). Opportunity: Reduces reliance on external services (e.g., AWS ALB, Nginx) for routing or WebSockets.
  • Roadmap: Enables gradual migration from sync (e.g., Symfony) to async PHP, with clear upgrade paths via the Amp ecosystem (e.g., amphp/http-client).

When to Consider This Package

  • Avoid if:
    • Your app is blocking-I/O heavy (e.g., legacy PHP with file_get_contents, mysqli). Requires rewriting or offloading to workers (e.g., Amp’s Parallel).
    • You need PHP 8.1+ only. Blocks adoption for older stacks (e.g., shared hosting).
    • Your team lacks async PHP experience. Steep learning curve for fibers, coroutines, and non-blocking I/O (e.g., Future, Amp\async()).
    • You prioritize simplicity over performance. Overkill for CRUD APIs with predictable, low-concurrency traffic.
    • You’re locked into sync frameworks (e.g., Laravel’s built-in server) and lack time/resources to refactor.
  • Look elsewhere if:
    • You need graphQL: Use graphql-php + a sync server.
    • You require WSGI/Python interop: Use uWSGI or Gunicorn.
    • Your use case is serverless: Prefer AWS Lambda, Cloudflare Workers, or Bref (PHP on Lambda).
    • You need built-in admin panels: Pair with Filament or Backpack on a sync stack.

How to Pitch It (Stakeholders)

For Executives:

"This package lets us build ultra-scalable PHP APIs without sacrificing performance or developer productivity. Think of it as ‘Node.js concurrency for PHP’—enabling real-time features (like live updates or chat) and handling 10x more concurrent users than traditional PHP servers. By adopting this, we can:

  • Reduce cloud costs by eliminating Nginx/Apache for static assets and WebSockets.
  • Future-proof our stack with HTTP/2 and async I/O, critical for mobile/web apps.
  • Attract top engineers who want to work with modern, concurrent systems (like Go/Rust devs). It’s a drop-in replacement for Laravel’s built-in server but with superpowers—ideal for our high-growth [Product X] roadmap."

For Engineering:

"amphp/http-server is a batteries-included async HTTP server for PHP, built on Amp’s fiber-based event loop. Here’s why it’s a game-changer:

  • Performance: Handles 10K+ concurrent connections (vs. ~1K for sync PHP) with minimal memory.
  • Ecosystem: Integrates with amphp/websocket-server, amphp/http-client, and PSR-15 middleware.
  • Flexibility:
    • HTTP/2 support out of the box (multiplexing, server push).
    • Middleware stack for auth, logging, CORS—just like Laravel but async.
    • Static file serving (no need for Nginx).
  • Migration Path:
    • Start with a hybrid stack: Use this for async endpoints (e.g., WebSockets) while keeping sync routes in Laravel.
    • Gradually replace blocking I/O with Amp’s non-blocking libraries (e.g., amphp/mysql).
  • Trade-offs:
    • Steep learning curve: Requires understanding fibers, Future, and coroutines.
    • PHP 8.1+ only: Blocks legacy support. Proposal: Pilot this for our [real-time dashboard] feature, then expand to APIs with high concurrency needs (e.g., notifications, live collaboration)."*

For DevOps/SRE:

"This package eliminates Nginx/Apache for PHP in many cases, reducing infrastructure complexity:

  • Single-process server: No need for PHP-FPM + Nginx proxying (cuts overhead).
  • HTTP/2 native: No config tweaks needed for modern protocols.
  • Resource efficiency: Uses ~1MB RAM per 1K connections (vs. ~50MB for PHP-FPM). Recommendation:
  • Benchmark against RoadRunner or Swoole for your workload.
  • Use SocketHttpServer::createForBehindProxy() if behind Nginx (avoids IP limits).
  • Monitor connection limits (default: 1K concurrent requests)—adjust with setConcurrentRequestLimit() if needed."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle