reception/listener/config/
mod.rs

1mod websocket_config;
2
3use serde::Deserialize;
4
5use crate::connection::ConnectionConfig;
6
7pub use self::websocket_config::WebSocketConfig;
8
9/// Configures the listener.
10#[derive(Debug, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord)]
11pub struct ListenerConfig {
12    /// Interface to which the listener will bind.
13    ///
14    /// Default: `"127.0.0.1"`
15    pub interface: String,
16
17    /// Port to which the listener will bind.
18    ///
19    /// Default: `8080`
20    pub port: u16,
21
22    /// Configuration for WebSockets.
23    pub websocket_config: WebSocketConfig,
24
25    /// Configuration for peer connections.
26    pub connection_config: ConnectionConfig,
27}
28
29impl Default for ListenerConfig {
30    fn default() -> Self {
31        Self {
32            interface: "127.0.0.1".to_owned(),
33            port: 8080,
34            websocket_config: Default::default(),
35            connection_config: Default::default(),
36        }
37    }
38}