Skip to content

Commit

Permalink
chore: Refactor code in local/utils.rs for better readability and mai…
Browse files Browse the repository at this point in the history
…ntainability
  • Loading branch information
arloor committed Sep 4, 2024
1 parent 9c77113 commit a334768
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/shadowsocks-service/src/local/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
use std::{io, net::SocketAddr, time::Duration};

use log::{debug, trace};
use shadowsocks::{
config::ServerConfig,
relay::{socks5::Address, tcprelay},
};
use shadowsocks::{config::ServerConfig, relay::socks5::Address};
use tokio::{
io::{copy_bidirectional, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt},
time,
Expand Down Expand Up @@ -69,7 +66,8 @@ where
#[cfg(feature = "https-tunnel")]
let result = copy_bidirectional(shadow, plain).await;
#[cfg(not(feature = "https-tunnel"))]
let result = tcprelay::utils::copy_encrypted_bidirectional(svr_cfg.method(), shadow, plain).await;
let result =
shadowsocks::relay::tcprelay::utils::copy_encrypted_bidirectional(svr_cfg.method(), shadow, plain).await;
match result {
Ok((wn, rn)) => {
trace!(
Expand Down

0 comments on commit a334768

Please sign in to comment.