From 8eb47013e594cda680ed06d7c00ebc2d43015704 Mon Sep 17 00:00:00 2001 From: eric Date: Sat, 21 Feb 2026 23:35:17 +0800 Subject: [PATCH] Always sniff TLS and HTTP --- leaf/src/common/sniff.rs | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/leaf/src/common/sniff.rs b/leaf/src/common/sniff.rs index 6236e6d..b2dcd70 100644 --- a/leaf/src/common/sniff.rs +++ b/leaf/src/common/sniff.rs @@ -8,33 +8,14 @@ use bytes::BytesMut; use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, ReadBuf}; use tokio::time::timeout; -use crate::option; use crate::session::Session; fn should_sniff_tls(sess: &Session) -> bool { - if option::TLS_DOMAIN_SNIFFING.load(std::sync::atomic::Ordering::Relaxed) { - if !option::TLS_DOMAIN_SNIFFING_ALL.load(std::sync::atomic::Ordering::Relaxed) - && sess.destination.port() != 443 - { - return false; - } - true - } else { - false - } + sess.destination.port() == 443 } fn should_sniff_http(sess: &Session) -> bool { - if option::HTTP_DOMAIN_SNIFFING.load(std::sync::atomic::Ordering::Relaxed) { - if !option::HTTP_DOMAIN_SNIFFING_ALL.load(std::sync::atomic::Ordering::Relaxed) - && sess.destination.port() != 80 - { - return false; - } - true - } else { - false - } + sess.destination.port() == 80 } pub fn should_sniff(sess: &Session) -> bool {