From f7349cdbc0ca2fe2806b72a101874be3fea9cafb Mon Sep 17 00:00:00 2001 From: eric Date: Sun, 15 Nov 2020 02:00:44 +0800 Subject: [PATCH] Fix build --- leaf/Cargo.toml | 12 ++++++------ leaf/src/util.rs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/leaf/Cargo.toml b/leaf/Cargo.toml index ff74c21..fbf2f1f 100644 --- a/leaf/Cargo.toml +++ b/leaf/Cargo.toml @@ -23,6 +23,8 @@ all-configs = [ "config-json", ] all-endpoints = [ + "inbound-http", + "inbound-socks", "outbound-direct", "outbound-drop", "outbound-redirect", @@ -34,8 +36,6 @@ all-endpoints = [ "outbound-ws", "outbound-vless", "outbound-h2", - "inbound-http", - "inbound-socks", "outbound-failover", "outbound-random", "outbound-tryall", @@ -147,10 +147,6 @@ http = { version = "0.2", optional = true } # SOCKS outbound async-socks5 = { version = "0.3", optional = true } -# TUN -[target.'cfg(any(target_os = "ios", target_os = "macos", target_os = "linux"))'.dependencies] -tun = { git = "https://github.com/eycorsican/rust-tun.git", branch = "fix", features = ["async"] } - # VMess lz_fnv = { version = "0.1", optional = true } cfb-mode = { version = "0.5", optional = true } @@ -173,6 +169,10 @@ sha-1 = { version = "0.9", optional = true } sha2 = { version = "0.9", optional = true } hex = { version = "0.4", optional = true } +# TUN +[target.'cfg(any(target_os = "ios", target_os = "macos", target_os = "linux"))'.dependencies] +tun = { git = "https://github.com/eycorsican/rust-tun.git", branch = "fix", features = ["async"] } + [build-dependencies] cc = "1.0" bindgen = "0.55" diff --git a/leaf/src/util.rs b/leaf/src/util.rs index 56cce4f..bc9bcf1 100644 --- a/leaf/src/util.rs +++ b/leaf/src/util.rs @@ -8,7 +8,7 @@ use tokio::runtime; #[cfg(feature = "inbound-socks")] use crate::proxy::socks; -#[cfg(feature = "feature-http")] +#[cfg(feature = "inbound-http")] use crate::proxy::http; use crate::{ @@ -32,7 +32,7 @@ pub fn create_runners(config: Config) -> Result> { let mut runners: Vec = Vec::new(); for inbound in config.inbounds.into_iter() { match inbound.protocol.as_str() { - #[cfg(feature = "feature-http")] + #[cfg(feature = "inbound-http")] "http" => { if let Ok(r) = http::inbound::new(inbound, dispatcher.clone()) { runners.push(r);