Triangle MultiConnect
triangle/multiconnect provides GatewayServer and ConnectionManager for long-lived TCP/WebSocket connections. It assigns random connection IDs, supports UID and group membership, and sends data to clients known by the current process. Triangle applications register the handler as a separate process; the package can also be used without Triangle.
The inspected source revision requires PHP ^8.1 and Localzet Server ^7.0. The optional localzet/cluster package adds a distributed-delivery adapter; it does not replace Cluster configuration or process startup. No published tag or release was confirmed in the inspected source, so these guides document the source contract rather than promise a Packagist version.
Guides
- Installation and process registration
- Usage and API
- Compatibility, security and tests
- Обзор на русском
Scope boundary
ConnectionManager keeps state in one worker process. With multiple workers, each knows only its own connections. sendToAll() targets the current registry, not every worker or host. Use the Cluster adapter for cross-process delivery and configure Cluster processes separately.
The gateway registers a connection in onConnect, dispatches incoming messages to onClientMessage, and removes the record in onClose. The package does not define authentication, session storage, or client reconnection policy.

