GEMVC Documentation
Complete guide to building modern, secure PHP applications with GEMVC framework
WebSocket Components
Overview
GEMVC provides WebSocket functionality through the SwooleWebSocketHandler
class, which is built on top of OpenSwoole/Swoole for high-performance real-time communication.
Core Components
SwooleWebSocketHandler
The main WebSocket handler class located in src/http/SwooleWebSocketHandler.php
.
Features
- Connection Management: Tracks active connections with timeout handling
- Rate Limiting: Prevents spam with configurable message limits
- Heartbeat System: Maintains connection health with ping/pong
- Channel System: Subscribe/unsubscribe to message channels
- Redis Integration: Optional Redis backend for scalability
- Authentication: JWT-based authentication support