2Q2DF2ROXVXS4WCJ3HTYPHMWFBIZLDYHMNFUODWBI7RACKFNFNZQC
pub fn update_proxy_command(&mut self) {
if let Some(ref h) = self.host_name {
if let Some(ref mut prox) = self.proxy_command {
*prox = prox.replace("%h", h);
}
fn update_proxy_command(&mut self) {
if let Some(ref mut prox) = self.proxy_command {
*prox = prox.replace("%h", &self.host_name);
*prox = prox.replace("%p", &format!("{}", self.port));
if let Some(ref p) = self.port {
if let Some(ref mut prox) = self.proxy_command {
*prox = prox.replace("%p", &format!("{}", p));
}
}
pub async fn stream(&mut self) -> Result<Stream, std::io::Error> {
self.update_proxy_command();
if let Some(ref proxy_command) = self.proxy_command {
let cmd: Vec<&str> = proxy_command.split(' ').collect();
Stream::proxy_command(cmd[0], &cmd[1..]).await
} else {
Stream::tcp_connect(&(self.host_name.as_str(), self.port).to_socket_addrs()?.next().unwrap()).await
"hostname" => config.host_name = Some(value.trim_start().to_string()),
"port" => config.port = value.trim_start().parse().ok(),
"hostname" => {
config.host_name.clear();
config.host_name.push_str(value.trim_start())
},
"port" => if let Ok(port) = value.trim_start().parse() {
config.port = port
},