Download the PHP package tourze/quic-packets without Composer
On this page you can find all versions of the php package tourze/quic-packets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package quic-packets
QUIC Packets
中文
[]
(https://packagist.org/packages/tourze/quic-packets)
[
]
(https://packagist.org/packages/tourze/quic-packets)
[
]
(https://packagist.org/packages/tourze/quic-packets)
A comprehensive QUIC packet handling library implementing RFC 9000 specifications for PHP 8.1+.
Table of Contents
- Features
- Requirements
- Installation
- Quick Start
- API Reference
- Advanced Usage
- Testing
- Architecture
- Performance
- Security
- Contributing
- License
- Roadmap
- References
Features
- RFC 9000 Compliant: Full support for QUIC packet format specifications
- Complete Packet Types: Initial, Handshake, and 1-RTT packets
- Efficient Encoding/Decoding: Optimized binary packet serialization
- Packet Number Management: Automatic numbering with loss detection
- Type-Safe Design: Modern PHP 8.1+ with enums and readonly properties
- Comprehensive Testing: 215 tests with 591 assertions across 19 test files
Requirements
- PHP 8.1 or higher
- No external dependencies for core functionality
Installation
Install via Composer:
Quick Start
Basic Packet Creation and Encoding
Packet Number Space Management
Handshake Packets
1-RTT Data Packets
API Reference
Core Classes
PacketType: Enum defining QUIC packet types (Initial, Handshake, 1-RTT, etc.)Packet: Abstract base class for all packet typesLongHeaderPacket: Base class for Initial and Handshake packetsShortHeaderPacket: For 1-RTT encrypted data packetsPacketEncoder: Encodes packet objects to binary dataPacketDecoder: Decodes binary data to packet objectsPacketNumberSpace: Manages packet numbering and acknowledgments
Supported Packet Types
| Type | Class | Description | Status |
|---|---|---|---|
| Initial | InitialPacket |
Connection establishment | ✅ Complete |
| Handshake | HandshakePacket |
TLS handshake completion | ✅ Complete |
| 1-RTT | ShortHeaderPacket |
Encrypted data transmission | ✅ Complete |
| 0-RTT | ZeroRTTPacket |
Early data | ✅ Complete |
| Retry | RetryPacket |
Stateless retry | ✅ Complete |
| Version Negotiation | VersionNegotiationPacket |
Version agreement | ✅ Complete |
| Stateless Reset | StatelessResetPacket |
Connection reset | ✅ Complete |
Advanced Usage
Batch Processing
Packet Type Detection
Validation
Testing
Run the test suite:
From project root:
Architecture
The library follows a clean, object-oriented design:
Performance
- Memory Efficient: Readonly properties minimize memory usage
- Fast Encoding: Optimized binary serialization
- Type Safety: Compile-time type checking prevents runtime errors
Security
This library is designed for QUIC packet handling and follows security best practices:
- Input Validation: All packet data is validated during decoding
- Type Safety: Strong typing prevents common security vulnerabilities
- No External Dependencies: Minimal attack surface for core functionality
- Memory Safe: Readonly properties prevent unintended modifications
For security vulnerabilities, please email [email protected] instead of using the issue tracker.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
License
The MIT License (MIT). Please see License File for more information.
Roadmap
- [x] 0-RTT packet support
- [x] Retry packet implementation
- [x] Version negotiation packets
- [x] Stateless reset packets
- [ ] Packet encryption integration
- [ ] Performance optimizations
- [ ] Packet fragmentation support