base64 removed

This commit is contained in:
ssrlive 2025-01-03 11:10:14 +08:00
parent 51de01854b
commit ecd1ab80bf
2 changed files with 2 additions and 4 deletions

View file

@ -28,7 +28,7 @@ udpgw = []
[dependencies] [dependencies]
async-trait = "0.1" async-trait = "0.1"
base64 = { version = "0.22" } base64easy = "0.1"
chrono = "0.4" chrono = "0.4"
clap = { version = "4", features = ["derive", "wrap_help", "color"] } clap = { version = "4", features = ["derive", "wrap_help", "color"] }
ctrlc2 = { version = "3", features = ["tokio", "termination"] } ctrlc2 = { version = "3", features = ["tokio", "termination"] }

View file

@ -4,7 +4,6 @@ use crate::{
proxy_handler::{ProxyHandler, ProxyHandlerManager}, proxy_handler::{ProxyHandler, ProxyHandlerManager},
session_info::{IpProtocol, SessionInfo}, session_info::{IpProtocol, SessionInfo},
}; };
use base64::Engine;
use httparse::Response; use httparse::Response;
use socks5_impl::protocol::UserKey; use socks5_impl::protocol::UserKey;
use std::{ use std::{
@ -141,8 +140,7 @@ impl HttpConnection {
.extend(format!("{}: {}\r\n", PROXY_AUTHORIZATION, response.to_header_string()).as_bytes()); .extend(format!("{}: {}\r\n", PROXY_AUTHORIZATION, response.to_header_string()).as_bytes());
} }
AuthenticationScheme::Basic => { AuthenticationScheme::Basic => {
let cred = format!("{}:{}", credentials.username, credentials.password); let auth_b64 = base64easy::encode(credentials.to_string(), base64easy::EngineKind::Standard);
let auth_b64 = base64::engine::general_purpose::STANDARD.encode(cred);
self.server_outbuf self.server_outbuf
.extend(format!("{}: Basic {}\r\n", PROXY_AUTHORIZATION, auth_b64).as_bytes()); .extend(format!("{}: Basic {}\r\n", PROXY_AUTHORIZATION, auth_b64).as_bytes());
} }