Struct shadowsocks_service::config::Config [−][src]
Configuration
Fields
server: Vec<ServerConfig>
Remote ShadowSocks server configurations
local_addr: Option<IpAddr>
Local server’s bind address, or ShadowSocks server’s outbound address
local: Vec<LocalConfig>
Local server configuration
dns: DnsConfig
DNS configuration, uses system-wide DNS configuration by default
Value could be a IpAddr
, uses UDP DNS protocol with port 53
. For example: 8.8.8.8
Also Value could be some pre-defined DNS server names:
google
cloudflare
,cloudflare_tls
,cloudflare_https
quad9
,quad9_tls
ipv6_first: bool
Uses IPv6 addresses first
Set to true
if you want to query IPv6 addresses before IPv4
no_delay: bool
Set TCP_NODELAY
socket option
nofile: Option<u64>
RLIMIT_NOFILE
option for *nix systems
outbound_fwmark: Option<u32>
Set SO_MARK
socket option for outbound sockets
outbound_bind_interface: Option<OsString>
Set SO_BINDTODEVICE
socket option for outbound sockets
inbound_send_buffer_size: Option<u32>
Set SO_SNDBUF
for inbound sockets
inbound_recv_buffer_size: Option<u32>
Set SO_RCVBUF
for inbound sockets
outbound_send_buffer_size: Option<u32>
Set SO_SNDBUF
for outbound sockets
outbound_recv_buffer_size: Option<u32>
Set SO_RCVBUF
for outbound sockets
manager: Option<ManagerConfig>
Manager’s configuration
config_type: ConfigType
Config is for Client or Server
udp_timeout: Option<Duration>
Timeout for UDP Associations, default is 5 minutes
udp_max_associations: Option<usize>
Maximum number of UDP Associations, default is unconfigured
acl: Option<AccessControl>
ACL configuration
Implementations
impl Config
[src]
pub fn new(config_type: ConfigType) -> Config
[src]
Creates an empty configuration
pub fn set_dns_formatted(&mut self, dns: &str) -> Result<(), Error>
[src]
Set DNS configuration in string format
[(unix|tcp|udp)://]host[:port][,host[:port]]...
- Pre-defined. Like
google
,cloudflare
pub fn load_from_str(s: &str, config_type: ConfigType) -> Result<Config, Error>
[src]
Load Config from a str
pub fn load_from_file(
filename: &str,
config_type: ConfigType
) -> Result<Config, Error>
[src]
filename: &str,
config_type: ConfigType
) -> Result<Config, Error>
Load Config from a File
pub fn has_server_plugins(&self) -> bool
[src]
Check if there are any plugin are enabled with servers
pub fn check_integrity(&self) -> Result<(), Error>
[src]
Check if all required fields are already set
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Any + Clone,
T: Any + Clone,
impl<T> CloneAny for T where
T: Any + Clone,
T: Any + Clone,
pub fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>
pub fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send, Global> where
T: Send,
T: Send,
pub fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync, Global> where
T: Sync,
T: Sync,
pub fn clone_any_send_sync(
&self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
T: Send + Sync,
&self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
T: Send + Sync,
impl<T> DebugAny for T where
T: Any + Debug,
T: Any + Debug,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,