[−][src]Struct shadowsocks::config::Config
Configuration
Fields
server: Vec<ServerConfig>Remote ShadowSocks server configurations
local_addr: Option<ClientConfig>Local server's bind address, or ShadowSocks server's outbound address
forward: Option<Address>Destination address for tunnel
dns: Option<String>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:
googlecloudflare,cloudflare_tls,cloudflare_httpsquad9,quad9_tls
mode: ModeServer mode, tcp_only, tcp_and_udp, and udp_only
no_delay: boolSet TCP_NODELAY socket option
manager: Option<ManagerConfig>Manager's configuration
config_type: ConfigTypeConfig 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
nofile: Option<u64>RLIMIT_NOFILE option for *nix systems
acl: Option<AccessControl>ACL configuration
tcp_redir: RedirTypePath to stat callback unix address, only for Android TCP Transparent Proxy type
udp_redir: RedirTypeUDP Transparent Proxy type
protect_path: Option<PathBuf>Path to protect callback unix address, only for Android
local_dns_path: Option<PathBuf>Path for local DNS resolver, only for Android
local_dns_addr: Option<SocketAddr>Local DNS's address
Sending DNS query directly to this address
remote_dns_addr: Option<Address>Remote DNS's address
Sending DNS query through proxy to this address
ipv6_first: boolUses IPv6 addresses first
Set to true if you want to query IPv6 addresses before IPv4
tls_identity_path: Option<PathBuf>TLS cryptographic identity (X509), PKCS #12 format
tls_identity_password: Option<String>TLS cryptographic identity's password
Implementations
impl Config[src]
pub fn new(config_type: ConfigType) -> Config[src]
Creates an empty configuration
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> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,