amphp/socket
Async, non-blocking socket library for AMPHP. Provides client/server abstractions over TCP, UDP, and Unix domain sockets with DNS resolution, retries, connect timeouts, cancellation, and optional TLS encryption. Implements ReadableStream/WritableStream.
curl/file_get_contents), RPC systems, or pub/sub backends (e.g., NATS, MQTT brokers).amphp/http-client or react/http instead).amphp/http, ratchet, or php-redis.react/socket (better Windows support).To Executives:
"This package lets us build PHP services that handle thousands of concurrent connections (e.g., real-time dashboards, IoT telemetry) without spinning up threads or processes. It’s like Node.js’s net module but for PHP—critical for scaling our [X] system while reducing cloud costs by 30%."
To Engineers:
*"amphp/socket gives us non-blocking TCP/UDP/TLS with fibers (PHP 8.1+). Key wins:
amphp/http, amphp/redis, etc.
Tradeoff: Requires rewriting blocking I/O (e.g., stream_socket_server) to async patterns. Start with the HTTP client/server examples."*How can I help you explore Laravel packages today?