sockeon / sockeon
Framework-agnostic PHP WebSocket and HTTP server library with attribute-based routing and support for namespaces and rooms.
v1.1.0
2025-05-31 11:59 UTC
Requires
- php: >=8.0
Requires (Dev)
- ext-sockets: *
- pestphp/pest: ^3.8
- phpstan/phpstan: ^2.1
README
Welcome to Sockeon! A framework-agnostic PHP WebSocket and HTTP server library that provides attribute-based routing and powerful namespaces and rooms functionality.
Features
- WebSocket and HTTP combined server
- Attribute-based routing for both WebSocket events and HTTP endpoints
- Advanced HTTP request and response handling
- Path parameters and query parameter support
- RESTful API support with content negotiation
- Namespaces and rooms support for WebSocket communication
- Middleware support for authentication and request processing
- Zero dependencies - built with PHP core functionality only
- Easy-to-use event-based architecture
- Real-time bidirectional communication
- Room-based broadcasting for efficient message distribution
- Automatic client connection management
- WebSocket protocol features including ping/pong for connection health monitoring
- Comprehensive CORS support with configurable allowed origins, methods, and headers
- Secure origin validation for WebSocket connections and HTTP requests
- PSR-3 compliant logging system with flexible configuration options
- Exception handling with contextual logging and stack traces
- JSON data handling and serialization
- Cross-platform compatibility
- PHP client implementation for connecting to Sockeon WebSocket servers
Documentation
For complete documentation, examples, and API reference, please visit:
Requirements
- PHP >= 8.0
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.