pub struct TunnelConfig {
pub local_ip: String,
pub remote_ip: String,
pub mtu: u16,
pub obfuscation_mode: ObfuscationMode,
pub keepalive: KeepalivePreset,
pub dns_protection: bool,
pub dns_servers: Vec<String>,
pub blocked_domains: Vec<String>,
pub split_domains: Vec<String>,
pub max_reconnect_attempts: Option<u32>,
}Expand description
High-level tunnel configuration.
Fields§
§local_ip: StringLocal TUN interface IP address.
remote_ip: StringRemote peer IP address.
mtu: u16MTU for the tunnel interface.
obfuscation_mode: ObfuscationModeObfuscation mode for DPI bypass.
keepalive: KeepalivePresetKeepalive preset.
dns_protection: boolWhether to enable DNS leak protection.
dns_servers: Vec<String>DNS upstream servers.
blocked_domains: Vec<String>Domains to block via DNS.
split_domains: Vec<String>Domains that bypass the tunnel (split DNS).
max_reconnect_attempts: Option<u32>Maximum reconnect attempts (None = infinite).
Implementations§
Source§impl TunnelConfig
impl TunnelConfig
Sourcepub fn mobile(local_ip: &str, remote_ip: &str) -> Self
pub fn mobile(local_ip: &str, remote_ip: &str) -> Self
Configuration optimised for mobile networks (МТС, Beeline). Full obfuscation, aggressive keepalive, mobile reconnect.
Sourcepub fn corporate(local_ip: &str, remote_ip: &str) -> Self
pub fn corporate(local_ip: &str, remote_ip: &str) -> Self
Configuration for corporate/office networks.
Sourcepub fn auto(local_ip: &str, remote_ip: &str, network_hint: &str) -> Self
pub fn auto(local_ip: &str, remote_ip: &str, network_hint: &str) -> Self
Auto-detect configuration from network hint string.
Sourcepub fn block_domain(self, domain: &str) -> Self
pub fn block_domain(self, domain: &str) -> Self
Add a domain to block via DNS.
Sourcepub fn split_domain(self, domain: &str) -> Self
pub fn split_domain(self, domain: &str) -> Self
Add a split DNS domain (bypasses tunnel).
Trait Implementations§
Source§impl Clone for TunnelConfig
impl Clone for TunnelConfig
Source§fn clone(&self) -> TunnelConfig
fn clone(&self) -> TunnelConfig
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for TunnelConfig
impl RefUnwindSafe for TunnelConfig
impl Send for TunnelConfig
impl Sync for TunnelConfig
impl Unpin for TunnelConfig
impl UnsafeUnpin for TunnelConfig
impl UnwindSafe for TunnelConfig
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