feat: add Minecraft proxy and refresh dependencies

This commit is contained in:
Loki 2026-10-16 23:04:41 +02:00
parent a4d0880a0a
commit cfaad47948
Signed by: boba
GPG key ID: 6CDE87BC9A778D97
47 changed files with 2671 additions and 1005 deletions

View file

@ -78,11 +78,55 @@ fn default_prefix_min_unique_sources() -> u64 {
}
/// Секция `[protocol]`: протокольные обработчики (plugin-by-feature).
#[cfg(feature = "protocol-http")]
#[cfg(any(feature = "protocol-http", feature = "protocol-minecraft"))]
#[derive(Debug, Clone, Default, Deserialize)]
pub struct ProtocolConfig {
#[cfg(feature = "protocol-http")]
#[serde(default)]
pub http: HttpProtocolConfig,
#[cfg(feature = "protocol-minecraft")]
#[serde(default)]
pub minecraft: MinecraftProtocolConfig,
}
#[cfg(feature = "protocol-minecraft")]
#[derive(Debug, Clone, Deserialize)]
pub struct MinecraftProtocolConfig {
#[serde(default = "default_minecraft_enabled")]
pub enabled: bool,
#[serde(default = "default_minecraft_max_frame_bytes")]
pub max_frame_bytes: usize,
#[serde(default = "default_minecraft_timeout_secs")]
pub timeout_secs: u64,
#[serde(default, alias = "proxy_protocol")]
pub send_proxy_protocol: bool,
}
#[cfg(feature = "protocol-minecraft")]
impl Default for MinecraftProtocolConfig {
fn default() -> Self {
Self {
enabled: default_minecraft_enabled(),
max_frame_bytes: default_minecraft_max_frame_bytes(),
timeout_secs: default_minecraft_timeout_secs(),
send_proxy_protocol: false,
}
}
}
#[cfg(feature = "protocol-minecraft")]
fn default_minecraft_enabled() -> bool {
!cfg!(feature = "protocol-http")
}
#[cfg(feature = "protocol-minecraft")]
fn default_minecraft_max_frame_bytes() -> usize {
8192
}
#[cfg(feature = "protocol-minecraft")]
fn default_minecraft_timeout_secs() -> u64 {
5
}
/// Секция `[protocol.http]`: политика HTTP/1.1-обработчика на edge-ноде.