Struct shadowsocks::config::ServerConfig
source · pub struct ServerConfig { /* private fields */ }
Expand description
Configuration for a server
Implementations§
source§impl ServerConfig
impl ServerConfig
sourcepub fn new<A, P>(addr: A, password: P, method: CipherKind) -> ServerConfig
pub fn new<A, P>(addr: A, password: P, method: CipherKind) -> ServerConfig
Create a new ServerConfig
sourcepub fn set_method<P>(&mut self, method: CipherKind, password: P)
pub fn set_method<P>(&mut self, method: CipherKind, password: P)
Set encryption method
sourcepub fn set_plugin(&mut self, p: PluginConfig)
pub fn set_plugin(&mut self, p: PluginConfig)
Set plugin
sourcepub fn set_addr<A>(&mut self, a: A)where
A: Into<ServerAddr>,
pub fn set_addr<A>(&mut self, a: A)where
A: Into<ServerAddr>,
Set server addr
sourcepub fn addr(&self) -> &ServerAddr
pub fn addr(&self) -> &ServerAddr
Get server address
sourcepub fn identity_keys(&self) -> &[Bytes]
pub fn identity_keys(&self) -> &[Bytes]
Get identity keys (Client)
sourcepub fn clone_identity_keys(&self) -> Arc<Vec<Bytes>>
pub fn clone_identity_keys(&self) -> Arc<Vec<Bytes>>
Clone identity keys (Client)
sourcepub fn set_user_manager(&mut self, user_manager: ServerUserManager)
pub fn set_user_manager(&mut self, user_manager: ServerUserManager)
Set user manager, enable Server’s multi-user support with EIH
sourcepub fn user_manager(&self) -> Option<&ServerUserManager>
pub fn user_manager(&self) -> Option<&ServerUserManager>
Get user manager (Server)
sourcepub fn clone_user_manager(&self) -> Option<Arc<ServerUserManager>>
pub fn clone_user_manager(&self) -> Option<Arc<ServerUserManager>>
Clone user manager (Server)
sourcepub fn method(&self) -> CipherKind
pub fn method(&self) -> CipherKind
Get method
sourcepub fn plugin(&self) -> Option<&PluginConfig>
pub fn plugin(&self) -> Option<&PluginConfig>
Get plugin
sourcepub fn set_plugin_addr(&mut self, a: ServerAddr)
pub fn set_plugin_addr(&mut self, a: ServerAddr)
Set plugin address
sourcepub fn plugin_addr(&self) -> Option<&ServerAddr>
pub fn plugin_addr(&self) -> Option<&ServerAddr>
Get plugin address
sourcepub fn tcp_external_addr(&self) -> &ServerAddr
pub fn tcp_external_addr(&self) -> &ServerAddr
Get server’s TCP external address
sourcepub fn udp_external_addr(&self) -> &ServerAddr
pub fn udp_external_addr(&self) -> &ServerAddr
Get server’s UDP external address
sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
Set timeout
sourcepub fn set_remarks<S>(&mut self, remarks: S)
pub fn set_remarks<S>(&mut self, remarks: S)
Set server’s remark
sourcepub fn weight(&self) -> &ServerWeight
pub fn weight(&self) -> &ServerWeight
Get server’s balancer weight
sourcepub fn set_weight(&mut self, weight: ServerWeight)
pub fn set_weight(&mut self, weight: ServerWeight)
Set server’s balancer weight
sourcepub fn to_qrcode_url(&self) -> String
pub fn to_qrcode_url(&self) -> String
Get URL for QRCode
ss:// + base64(method:password@host:port)
sourcepub fn from_url(encoded: &str) -> Result<ServerConfig, UrlParseError>
pub fn from_url(encoded: &str) -> Result<ServerConfig, UrlParseError>
Parse from SIP002 URL
Extended formats:
- QRCode URL supported by shadowsocks-android, https://github.com/shadowsocks/shadowsocks-android/issues/51
- Plain userinfo:password format supported by go2-shadowsocks2
Trait Implementations§
source§impl Clone for ServerConfig
impl Clone for ServerConfig
source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ServerConfig
impl Debug for ServerConfig
source§impl FromStr for ServerConfig
impl FromStr for ServerConfig
Auto Trait Implementations§
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
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