diff --git a/Cargo.lock b/Cargo.lock index 1596fc847..9b933eb15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1060,7 +1060,7 @@ dependencies = [ "tracing-oslog", "tracing-subscriber", "tracing-timing", - "tuic 5.0.0", + "tuic", "tuic-quinn", "tun", "url", @@ -6436,14 +6436,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "tuic" -version = "5.0.0" -source = "git+https://github.com/Itsusinn/tuic.git?tag=v1.1.2-fix1#d6e1416d923cbc5f80fafc51927823ada3693901" -dependencies = [ - "uuid", -] - [[package]] name = "tuic-quinn" version = "1.2.0" @@ -6453,7 +6445,7 @@ dependencies = [ "futures-util", "quinn", "thiserror", - "tuic 1.2.0", + "tuic", "uuid", ] diff --git a/clash_lib/src/proxy/converters/shadowsocks.rs b/clash_lib/src/proxy/converters/shadowsocks.rs index def5ce33e..28e448c39 100644 --- a/clash_lib/src/proxy/converters/shadowsocks.rs +++ b/clash_lib/src/proxy/converters/shadowsocks.rs @@ -36,15 +36,20 @@ impl TryFrom<&OutboundShadowsocks> for Handler { cipher: s.cipher.to_owned(), plugin_opts: match &s.plugin { Some(plugin) => match plugin.as_str() { - "obfs" => s - .plugin_opts - .clone() - .ok_or(Error::InvalidConfig( - "plugin_opts is required for plugin obfs".to_owned(), - ))? - .try_into() - .map(OBFSOption::Simple) - .ok(), + "obfs" => { + tracing::warn!( + "simple-obfs is deprecated, please use v2ray-plugin \ + instead" + ); + s.plugin_opts + .clone() + .ok_or(Error::InvalidConfig( + "plugin_opts is required for plugin obfs".to_owned(), + ))? + .try_into() + .map(OBFSOption::Simple) + .ok() + } "v2ray-plugin" => s .plugin_opts .clone() diff --git a/clash_lib/src/proxy/shadowsocks/mod.rs b/clash_lib/src/proxy/shadowsocks/mod.rs index 02819dbec..41c4e4a3c 100644 --- a/clash_lib/src/proxy/shadowsocks/mod.rs +++ b/clash_lib/src/proxy/shadowsocks/mod.rs @@ -109,23 +109,17 @@ impl Handler { ) -> std::io::Result { let stream: AnyStream = match &self.opts.plugin_opts { Some(plugin) => match plugin { - OBFSOption::Simple(opts) => { - tracing::warn!( - "simple-obfs is deprecated, please use v2ray-plugin instead" - ); - match opts.mode { - SimpleOBFSMode::Http => simple_obfs::SimpleObfsHTTP::new( - s, - opts.host.clone(), - self.opts.port, - ) - .into(), - SimpleOBFSMode::Tls => { - simple_obfs::SimpleObfsTLS::new(s, opts.host.clone()) - .into() - } + OBFSOption::Simple(opts) => match opts.mode { + SimpleOBFSMode::Http => simple_obfs::SimpleObfsHTTP::new( + s, + opts.host.clone(), + self.opts.port, + ) + .into(), + SimpleOBFSMode::Tls => { + simple_obfs::SimpleObfsTLS::new(s, opts.host.clone()).into() } - } + }, OBFSOption::V2Ray(_opt) => { todo!("v2ray-plugin is not implemented yet") }