pub struct Config {
pub source_type: ProxyType,
pub listen_addr: SocketAddr,
pub username: Option<String>,
pub password: Option<String>,
pub server_addr: SocketAddr,
pub s5_username: Option<String>,
pub s5_password: Option<String>,
pub acl_file: Option<PathBuf>,
pub verbosity: ArgVerbosity,
}Expand description
Proxy tunnel from HTTP or SOCKS5 to SOCKS5
Fields§
§source_type: ProxyTypeSource proxy type
listen_addr: SocketAddrLocal listening address
username: Option<String>Client authentication username, available both for HTTP and SOCKS5, optional
password: Option<String>Client authentication password, available both for HTTP and SOCKS5, optional
server_addr: SocketAddrRemote SOCKS5 server address
s5_username: Option<String>Remote SOCKS5 server authentication username, optional
s5_password: Option<String>Remote SOCKS5 server authentication password, optional
acl_file: Option<PathBuf>ACL (Access Control List) file path, optional
verbosity: ArgVerbosityLog verbosity level
Implementations§
source§impl Config
impl Config
pub fn parse_args() -> Self
pub fn new(listen_addr: SocketAddr, server_addr: SocketAddr) -> Self
pub fn source_type(&mut self, source_type: ProxyType) -> &mut Self
pub fn listen_addr(&mut self, listen_addr: SocketAddr) -> &mut Self
pub fn server_addr(&mut self, server_addr: SocketAddr) -> &mut Self
pub fn username(&mut self, username: &str) -> &mut Self
pub fn password(&mut self, password: &str) -> &mut Self
pub fn s5_username(&mut self, s5_username: &str) -> &mut Self
pub fn s5_password(&mut self, s5_password: &str) -> &mut Self
pub fn acl_file<P: Into<PathBuf>>(&mut self, acl_file: P) -> &mut Self
pub fn verbosity(&mut self, verbosity: ArgVerbosity) -> &mut Self
pub fn get_credentials(&self) -> Credentials
pub fn get_s5_credentials(&self) -> Credentials
Trait Implementations§
source§impl CommandFactory for Config
impl CommandFactory for Config
source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromArgMatches for Config
impl FromArgMatches for Config
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>
Assign values from
ArgMatches to self.source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>
Assign values from
ArgMatches to self.source§impl Parser for Config
impl Parser for Config
source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Update from iterator, exit on error.
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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