Update On Sun May 12 20:29:14 CEST 2024

This commit is contained in:
github-action[bot]
2024-05-12 20:29:15 +02:00
parent d902f4e54b
commit bea46d294a
2547 changed files with 56527 additions and 91299 deletions

View File

@@ -301,6 +301,15 @@ impl Default for ServerUserManager {
}
}
/// The source of the ServerConfig
#[derive(Debug, Clone, Copy)]
pub enum ServerSource {
Default, //< Default source, created in code
Configuration, //< Created from configuration
CommandLine, //< Created from command line
OnlineConfig, //< Created from online configuration (SIP008)
}
/// Configuration for a server
#[derive(Clone, Debug)]
pub struct ServerConfig {
@@ -340,6 +349,9 @@ pub struct ServerConfig {
/// Weight
weight: ServerWeight,
/// Source
source: ServerSource,
}
#[cfg(feature = "aead-cipher-2022")]
@@ -452,6 +464,7 @@ impl ServerConfig {
id: None,
mode: Mode::TcpAndUdp, // Server serves TCP & UDP by default
weight: ServerWeight::new(),
source: ServerSource::Default,
}
}
@@ -618,6 +631,16 @@ impl ServerConfig {
self.weight = weight;
}
/// Get server's source
pub fn source(&self) -> ServerSource {
self.source
}
/// Set server's source
pub fn set_source(&mut self, source: ServerSource) {
self.source = source;
}
/// Get URL for QRCode
/// ```plain
/// ss:// + base64(method:password@host:port)