pub struct Proxy {Show 60 fields
pub proxy_type: ProxyType,
pub combined_proxy: Option<CombinedProxy>,
pub id: u32,
pub group_id: i32,
pub group: String,
pub remark: String,
pub hostname: String,
pub port: u16,
pub username: Option<String>,
pub password: Option<String>,
pub encrypt_method: Option<String>,
pub plugin: Option<String>,
pub plugin_option: Option<String>,
pub protocol: Option<String>,
pub protocol_param: Option<String>,
pub obfs: Option<String>,
pub obfs_param: Option<String>,
pub user_id: Option<String>,
pub alter_id: u16,
pub transfer_protocol: Option<String>,
pub fake_type: Option<String>,
pub tls_secure: bool,
pub host: Option<String>,
pub path: Option<String>,
pub edge: Option<String>,
pub quic_secure: Option<String>,
pub quic_secret: Option<String>,
pub udp: Option<bool>,
pub tcp_fast_open: Option<bool>,
pub allow_insecure: Option<bool>,
pub tls13: Option<bool>,
pub underlying_proxy: Option<String>,
pub snell_version: u16,
pub server_name: Option<String>,
pub self_ip: Option<String>,
pub self_ipv6: Option<String>,
pub public_key: Option<String>,
pub private_key: Option<String>,
pub pre_shared_key: Option<String>,
pub dns_servers: HashSet<String>,
pub mtu: u16,
pub allowed_ips: String,
pub keep_alive: u16,
pub test_url: Option<String>,
pub client_id: Option<String>,
pub ports: Option<String>,
pub up_speed: u32,
pub down_speed: u32,
pub auth: Option<String>,
pub auth_str: Option<String>,
pub sni: Option<String>,
pub fingerprint: Option<String>,
pub ca: Option<String>,
pub ca_str: Option<String>,
pub recv_window_conn: u32,
pub recv_window: u32,
pub disable_mtu_discovery: Option<bool>,
pub hop_interval: u32,
pub alpn: HashSet<String>,
pub cwnd: u32,
}Expand description
Represents a proxy configuration.
Fields§
§proxy_type: ProxyType§combined_proxy: Option<CombinedProxy>§id: u32§group_id: i32§group: String§remark: String§hostname: String§port: u16§username: Option<String>§password: Option<String>§encrypt_method: Option<String>§plugin: Option<String>§plugin_option: Option<String>Plugin options in the format of key1=value1;key2=value2
protocol: Option<String>§protocol_param: Option<String>§obfs: Option<String>§obfs_param: Option<String>§user_id: Option<String>§alter_id: u16§transfer_protocol: Option<String>§fake_type: Option<String>§tls_secure: bool§host: Option<String>§path: Option<String>§edge: Option<String>§quic_secure: Option<String>§quic_secret: Option<String>§udp: Option<bool>§tcp_fast_open: Option<bool>§allow_insecure: Option<bool>§tls13: Option<bool>§underlying_proxy: Option<String>§snell_version: u16§server_name: Option<String>§self_ip: Option<String>§self_ipv6: Option<String>§public_key: Option<String>§private_key: Option<String>§dns_servers: HashSet<String>§mtu: u16§allowed_ips: String§keep_alive: u16§test_url: Option<String>§client_id: Option<String>§ports: Option<String>§up_speed: u32upload speed in Mbps
down_speed: u32download speed in Mbps
auth: Option<String>§auth_str: Option<String>§sni: Option<String>§fingerprint: Option<String>§ca: Option<String>§ca_str: Option<String>§recv_window_conn: u32§recv_window: u32§disable_mtu_discovery: Option<bool>§hop_interval: u32§alpn: HashSet<String>§cwnd: u32Implementations§
Source§impl Proxy
impl Proxy
pub fn common_construct( proxy_type: ProxyType, group: &str, remark: &str, server: &str, port: u16, udp: Option<bool>, tfo: Option<bool>, scv: Option<bool>, tls13: Option<bool>, underlying_proxy: &str, ) -> Self
pub fn vmess_construct( group: &str, remark: &str, add: &str, port: u16, typ: &str, id: &str, aid: u16, net: &str, cipher: &str, path: &str, host: &str, edge: &str, tls: &str, sni: &str, udp: Option<bool>, tfo: Option<bool>, scv: Option<bool>, tls13: Option<bool>, underlying_proxy: &str, ) -> Self
pub fn ssr_construct( group: &str, remark: &str, server: &str, port: u16, protocol: &str, method: &str, obfs: &str, password: &str, obfs_param: &str, proto_param: &str, udp: Option<bool>, tfo: Option<bool>, scv: Option<bool>, underlying_proxy: &str, ) -> Self
pub fn ss_construct( group: &str, remark: &str, server: &str, port: u16, password: &str, method: &str, plugin: &str, plugin_opts: &str, udp: Option<bool>, tfo: Option<bool>, scv: Option<bool>, tls13: Option<bool>, underlying_proxy: &str, ) -> Self
pub fn socks_construct( group: &str, remark: &str, server: &str, port: u16, username: &str, password: &str, udp: Option<bool>, tfo: Option<bool>, scv: Option<bool>, underlying_proxy: &str, ) -> Self
pub fn http_construct( group: &str, remark: &str, server: &str, port: u16, username: &str, password: &str, tls: bool, tfo: Option<bool>, scv: Option<bool>, tls13: Option<bool>, underlying_proxy: &str, ) -> Self
pub fn trojan_construct( group: String, remark: String, hostname: String, port: u16, password: String, network: Option<String>, host: Option<String>, path: Option<String>, sni: Option<String>, tls_secure: bool, udp: Option<bool>, tfo: Option<bool>, allow_insecure: Option<bool>, tls13: Option<bool>, underlying_proxy: Option<String>, ) -> Self
pub fn snell_construct( group: String, remark: String, hostname: String, port: u16, password: String, obfs: String, host: String, version: u16, udp: Option<bool>, tfo: Option<bool>, allow_insecure: Option<bool>, underlying_proxy: Option<String>, ) -> Self
pub fn wireguard_construct( group: String, remark: String, hostname: String, port: u16, self_ip: String, self_ipv6: String, private_key: String, public_key: String, preshared_key: String, dns_servers: Vec<String>, mtu: Option<u16>, keep_alive: Option<u16>, test_url: String, client_id: String, udp: Option<bool>, underlying_proxy: Option<String>, ) -> Self
pub fn hysteria2_construct( group: String, remark: String, hostname: String, port: u16, ports: Option<String>, up_speed: Option<u32>, down_speed: Option<u32>, password: String, obfs: Option<String>, obfs_param: Option<String>, sni: Option<String>, fingerprint: Option<String>, alpn: Vec<String>, ca: Option<String>, ca_str: Option<String>, cwnd: Option<u32>, tcp_fast_open: Option<bool>, allow_insecure: Option<bool>, underlying_proxy: Option<String>, ) -> Self
pub fn hysteria_construct( group: String, remark: String, hostname: String, port: u16, ports: String, protocol: String, obfs_param: String, up_speed: Option<u32>, down_speed: Option<u32>, auth_str: String, obfs: String, sni: String, fingerprint: String, ca: String, ca_str: String, recv_window_conn: Option<u32>, recv_window: Option<u32>, disable_mtu_discovery: Option<bool>, hop_interval: Option<u32>, alpn: Vec<String>, tcp_fast_open: Option<bool>, allow_insecure: Option<bool>, underlying_proxy: Option<String>, ) -> Self
Source§impl Proxy
impl Proxy
pub fn is_combined_proxy(&self) -> bool
Sourcepub fn with_skip_cert_verify(self, scv: Option<bool>) -> Self
pub fn with_skip_cert_verify(self, scv: Option<bool>) -> Self
设置 Skip Cert Verify,如果值已存在则不覆盖
Sourcepub fn set_skip_cert_verify(self, scv: bool) -> Self
pub fn set_skip_cert_verify(self, scv: bool) -> Self
强制设置 Skip Cert Verify,不论是否已存在值
Sourcepub fn set_remark(self, remark: String) -> Self
pub fn set_remark(self, remark: String) -> Self
设置代理备注
Trait Implementations§
Source§impl From<Proxy> for ClashOutputAnyTLS
impl From<Proxy> for ClashOutputAnyTLS
Source§impl From<Proxy> for ClashProxyOutput
Implementation of From trait for ClashProxyOutput
impl From<Proxy> for ClashProxyOutput
Implementation of From trait for ClashProxyOutput
Source§impl From<Proxy> for Hysteria2Proxy
impl From<Proxy> for Hysteria2Proxy
Source§impl From<Proxy> for HysteriaProxy
impl From<Proxy> for HysteriaProxy
Source§impl From<Proxy> for ShadowsocksProxy
impl From<Proxy> for ShadowsocksProxy
Source§impl From<Proxy> for ShadowsocksRProxy
impl From<Proxy> for ShadowsocksRProxy
Source§impl From<Proxy> for SnellProxy
impl From<Proxy> for SnellProxy
Source§impl From<Proxy> for Socks5Proxy
impl From<Proxy> for Socks5Proxy
Source§impl From<Proxy> for TrojanProxy
impl From<Proxy> for TrojanProxy
Source§impl From<Proxy> for VLessProxy
impl From<Proxy> for VLessProxy
Source§impl From<Proxy> for VmessProxy
impl From<Proxy> for VmessProxy
Auto Trait Implementations§
impl Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnwindSafe for Proxy
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