Skip to main content

platform/config/bind/
mod.rs

1pub mod http;
2pub mod ice;
3
4pub use crate::config::bind::http::HttpBindConfig;
5pub use crate::config::bind::ice::IceBindConfig;
6use serde::{Deserialize, Serialize};
7
8/// 网络绑定配置
9///
10/// 定义不同类型服务的网络绑定参数。
11#[derive(Debug, Serialize, Deserialize, Clone)]
12pub struct BindConfig {
13    /// HTTP/HTTPS 服务绑定配置(可选)
14    ///
15    /// 统一的 HTTP 绑定。配置了 cert+key 即为 HTTPS,否则为 HTTP。
16    pub http: Option<HttpBindConfig>,
17
18    /// ICE 服务绑定配置
19    ///
20    /// 用于 STUN/TURN 服务的 UDP 绑定配置。
21    pub ice: IceBindConfig,
22}
23
24impl Default for BindConfig {
25    fn default() -> Self {
26        Self {
27            http: Some(HttpBindConfig::default()),
28            ice: IceBindConfig::default(),
29        }
30    }
31}