diff --git a/clash/tests/data/config/rules.yaml b/clash/tests/data/config/rules.yaml index f466897c..57deb77b 100644 --- a/clash/tests/data/config/rules.yaml +++ b/clash/tests/data/config/rules.yaml @@ -4,7 +4,7 @@ socks-port: 8889 mixed-port: 8899 tun: - enable: false + enable: true device-id: "dev://utun1989" dns: diff --git a/clash_lib/src/proxy/transport/tls.rs b/clash_lib/src/proxy/transport/tls.rs index 16d68185..5890c30f 100644 --- a/clash_lib/src/proxy/transport/tls.rs +++ b/clash_lib/src/proxy/transport/tls.rs @@ -3,7 +3,6 @@ use std::{io, sync::Arc}; use rustls::{ClientConfig, OwnedTrustAnchor, RootCertStore, ServerName}; use serde::Serialize; use tokio_rustls::TlsConnector; -use tracing::warn; use crate::{common::tls, proxy::AnyStream}; diff --git a/clash_lib/src/proxy/tun/inbound.rs b/clash_lib/src/proxy/tun/inbound.rs index 421a98b0..b222bc60 100644 --- a/clash_lib/src/proxy/tun/inbound.rs +++ b/clash_lib/src/proxy/tun/inbound.rs @@ -162,20 +162,7 @@ pub fn get_runner( } } - let network = cfg - .network - .as_ref() - .unwrap_or(&"198.19.0.0/16".to_owned()) - .parse::()?; - - tun_cfg - .address( - network.hosts().nth(0).expect( - format!("tun network {:?} doesn't contain any address", cfg.network).as_str(), - ), - ) - .netmask(network.netmask()) - .up(); + tun_cfg.up(); let tun = tun::create_as_async(&tun_cfg).map_err(map_io_error)?;