add bps limiter (#1015)

* add token bucket
* remove quinn-proto
This commit is contained in:
Sijie.Sun
2025-06-19 21:15:04 +08:00
committed by GitHub
parent 72d5ed908e
commit 40601bd05b
13 changed files with 463 additions and 38 deletions
+9
View File
@@ -40,6 +40,9 @@ message FlagsInConfig {
bool enable_quic_proxy = 24;
// does this peer allow quic input
bool disable_quic_input = 25;
// a global relay limit, only work for foreign network
uint64 foreign_relay_bps_limit = 26;
}
message RpcDescriptor {
@@ -180,3 +183,9 @@ message PortForwardConfigPb {
message ProxyDstInfo {
SocketAddr dst_addr = 1;
}
message LimiterConfig {
optional uint64 burst_rate = 1; // default 1 means no burst (capacity is same with bps)
optional uint64 bps = 2; // default 0 means no limit (unit is B/s)
optional uint64 fill_duration_ms = 3; // default 10ms, the period to fill the bucket
}