Download the PHP package tourze/workerman-rate-limit-protocol without Composer
On this page you can find all versions of the php package tourze/workerman-rate-limit-protocol. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tourze/workerman-rate-limit-protocol
More information about tourze/workerman-rate-limit-protocol
Files in tourze/workerman-rate-limit-protocol
Download tourze/workerman-rate-limit-protocol
More information about tourze/workerman-rate-limit-protocol
Files in tourze/workerman-rate-limit-protocol
Vendor tourze
Package workerman-rate-limit-protocol
Short Description Workerman Rate Limit Protocol
License MIT
Package workerman-rate-limit-protocol
Short Description Workerman Rate Limit Protocol
License MIT
Please rate this library. Is it a good library?
Informations about the package workerman-rate-limit-protocol
Workerman Rate Limit Protocol
中文
A rate limiting protocol implementation integrated with Workerman.
Features
- Provides traffic-based rate limiting protocol (bytes/second).
- Provides packet-based rate limiting protocol (packets/second).
- Supports setting default rate limits globally and overriding limits for specific connections.
- Non-intrusive usage, acts as a wrapper around existing Workerman protocols (defaults to raw TCP/UDP handling if no inner protocol specified).
- Uses
WeakMap
to store connection context for automatic memory management (no manual cleanup needed on connection close). - TCP Connections: Pauses receiving data (
pauseRecv
) instead of closing when the rate limit is exceeded. Resumes automatically after 1 second. - UDP Connections: Directly discards packets when the rate limit is exceeded.
- Important Note: Rate limiting is currently implemented per-process. In a multi-process Workerman setup, the limit applies independently to each worker process, not globally across all processes.
Installation
Quick Start
Traffic-based Rate Limiting (Bytes/Second)
Packet-based Rate Limiting (Packets/Second)
Notes
- Statistics are calculated per second, and counters reset every second for each connection independently.
- The core limiting logic happens within the
input
andencode
methods of the protocol classes.
Contributing
Please refer to the main project contribution guidelines if available. Issues and Pull Requests are welcome.
License
The MIT License (MIT). Please see the LICENSE file for more information.
All versions of workerman-rate-limit-protocol with dependencies
PHP Build Version
Package Version
The package tourze/workerman-rate-limit-protocol contains the following files
Loading the files please wait ....