pub struct GuardConfig {
pub egress_limit_bps: u64,
pub per_ip_media: u32,
pub accept_rate: f64,
pub accept_rate_per_ip: f64,
pub whep_rate_per_ip: f64,
pub whep_per_ip_max: u32,
pub ban_window: Duration,
pub ban_strikes: u32,
pub ban: Duration,
pub disabled: bool,
}Expand description
准入参数。默认值与 C 版一致。
Fields§
§egress_limit_bps: u64出口码率阈值(字节/秒);0 = 关闭码率准入。
per_ip_media: u32单 IP 媒体并发上限。
accept_rate: f64全局媒体建连速率(每秒)与突发(2 倍)。
accept_rate_per_ip: f64单 IP 媒体建连速率(每秒)与突发(2 倍)。
whep_rate_per_ip: f64单 IP WHEP 建连速率(每秒)。WHEP 是「一次 POST 建一个会话」,浏览器刷新/ 多标签页会瞬间连开几条,与 RTSP 长连接共用 10/s 必然误伤(实测两块浏览器就触发封禁)。
whep_per_ip_max: u32单 IP WHEP 并发会话上限。
ban_window: Duration只有「窗口内累计超限多少次」才封禁(单次超限只拒这一条)。
ban_strikes: u32连续超速多少次触发封禁。
ban: Duration封禁时长。
disabled: bool是否整体关闭(调试用)。
Implementations§
Source§impl GuardConfig
impl GuardConfig
Trait Implementations§
Auto Trait Implementations§
impl Forget for GuardConfig
impl Freeze for GuardConfig
impl Move for GuardConfig
impl RefUnwindSafe for GuardConfig
impl Send for GuardConfig
impl Sync for GuardConfig
impl Unpin for GuardConfig
impl UnsafeUnpin for GuardConfig
impl UnwindSafe for GuardConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more