Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug committed Sep 30, 2024
1 parent 2f1ffac commit dca1e05
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clash_lib/src/proxy/tproxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl InboundListener for Listener {
async fn listen_tcp(&self) -> std::io::Result<()> {
use socket2::Socket;
use tokio::net::TcpListener;
use tracing::info;
use tracing::trace;

use crate::{
proxy::utils::apply_tcp_options,
Expand Down Expand Up @@ -75,7 +75,7 @@ impl InboundListener for Listener {
..Default::default()
};

info!("tproxy new conn {}", sess);
trace!("tproxy new tcp conn {}", sess);

let dispatcher = self.dispather.clone();
tokio::spawn(async move {
Expand Down Expand Up @@ -140,15 +140,15 @@ async fn handle_inbound_datagram(

use super::tun::TunDatagram;

// dispatcher <-> tun communications
// dispatcher <-> tproxy communications
let (l_tx, mut l_rx) = tokio::sync::mpsc::channel(32);

// forward packets from tun to dispatcher
// forward packets from tproxy to dispatcher
let (d_tx, d_rx) = tokio::sync::mpsc::channel(32);

// for dispatcher - the dispatcher would receive packets from this channel,
// which is from the stack and send back packets to this channel, which is
// to the tun
// to the tproxy
let udp_stream = TunDatagram::new(l_tx, d_rx);

let sess = Session {
Expand Down

0 comments on commit dca1e05

Please sign in to comment.