fmt
This commit is contained in:
parent
327ad5425f
commit
484cef24c7
@ -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)]
|
||||||
|
@ -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(
|
.await
|
||||||
proxy_stream,
|
.unwrap()
|
||||||
server,
|
|
||||||
&username,
|
|
||||||
&password,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Socks5Stream::connect_with_socket(proxy_stream, server)
|
Socks5Stream::connect_with_socket(proxy_stream, server)
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
Loading…
Reference in New Issue
Block a user