fmt
This commit is contained in:
parent
327ad5425f
commit
484cef24c7
@ -2,9 +2,7 @@ use colored::*;
|
||||
use serde::Deserialize;
|
||||
use std::fs;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use tokio::io::{
|
||||
AsyncBufReadExt, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt,
|
||||
};
|
||||
use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
||||
use tokio::net::TcpStream;
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
|
@ -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 password = config.proxy_password.clone().unwrap();
|
||||
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
|
||||
.unwrap()
|
||||
} else {
|
||||
|
||||
Socks5Stream::connect_with_socket(proxy_stream, server)
|
||||
.await
|
||||
.unwrap()
|
||||
|
Loading…
Reference in New Issue
Block a user