This commit is contained in:
sad 2024-10-04 16:29:49 +00:00
parent 327ad5425f
commit 484cef24c7
2 changed files with 4 additions and 13 deletions

View File

@ -2,9 +2,7 @@ use colored::*;
use serde::Deserialize; use serde::Deserialize;
use std::fs; use std::fs;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
use tokio::io::{ use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
AsyncBufReadExt, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt,
};
use tokio::net::TcpStream; use tokio::net::TcpStream;
#[derive(Deserialize, Clone)] #[derive(Deserialize, Clone)]

View File

@ -16,17 +16,10 @@ pub async fn proxy_exec(config: &Config) -> Result<TcpStream, Box<dyn std::error
let username = config.proxy_username.clone().unwrap(); let username = config.proxy_username.clone().unwrap();
let password = config.proxy_password.clone().unwrap(); let password = config.proxy_password.clone().unwrap();
let tcp_stream = if !&username.is_empty() && !password.is_empty() { let tcp_stream = if !&username.is_empty() && !password.is_empty() {
Socks5Stream::connect_with_password_and_socket(proxy_stream, server, &username, &password)
Socks5Stream::connect_with_password_and_socket(
proxy_stream,
server,
&username,
&password,
)
.await .await
.unwrap() .unwrap()
} else { } else {
Socks5Stream::connect_with_socket(proxy_stream, server) Socks5Stream::connect_with_socket(proxy_stream, server)
.await .await
.unwrap() .unwrap()