From 3c635af4644a4e6591e764b1d87a469a0067b7aa Mon Sep 17 00:00:00 2001 From: arloor Date: Thu, 5 Sep 2024 00:08:18 +0800 Subject: [PATCH] chore: Update sslocal configuration to use 'host' instead of 'us.arloor.dev' --- crates/shadowsocks-service/src/local/utils.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/shadowsocks-service/src/local/utils.rs b/crates/shadowsocks-service/src/local/utils.rs index 9d6532f5dcac..cf7555b4f6a1 100644 --- a/crates/shadowsocks-service/src/local/utils.rs +++ b/crates/shadowsocks-service/src/local/utils.rs @@ -5,7 +5,7 @@ use std::{io, net::SocketAddr, time::Duration}; use log::{debug, trace}; use shadowsocks::{ config::ServerConfig, - relay::{socks5::Address, tcprelay::utils::copy_encrypted_bidirectional}, + relay::{socks5::Address, tcprelay}, }; use tokio::{ io::{copy_bidirectional, AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}, @@ -66,8 +66,11 @@ where } } } - - match copy_encrypted_bidirectional(svr_cfg.method(), shadow, plain).await { + #[cfg(feature = "https-tunnel")] + let result = tcprelay::utils::copy_bidirectional(shadow, plain).await; + #[cfg(not(feature = "https-tunnel"))] + let result = tcprelay::utils::copy_encrypted_bidirectional(svr_cfg.method(), shadow, plain).await; + match result { Ok((wn, rn)) => { trace!( "tcp tunnel {} <-> {} (proxied) closed, L2R {} bytes, R2L {} bytes",