Skip to content

Commit df8ce55

Browse files
committed
去除https-tunnel下的UDP支持
1 parent 5268c7e commit df8ce55

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

src/service/local.rs

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,6 @@ pub fn define_command_line_options(mut app: Command) -> Command {
103103
.value_parser(vparser::parse_server_addr)
104104
.help("Local address, listen only to this address if specified"),
105105
)
106-
.arg(
107-
Arg::new("UDP_ONLY")
108-
.short('u')
109-
.action(ArgAction::SetTrue)
110-
.conflicts_with("TCP_AND_UDP")
111-
.requires("LOCAL_ADDR")
112-
.help("Server mode UDP_ONLY"),
113-
)
114-
.arg(
115-
Arg::new("TCP_AND_UDP")
116-
.short('U')
117-
.action(ArgAction::SetTrue)
118-
.help("Server mode TCP_AND_UDP"),
119-
)
120106
.arg(
121107
Arg::new("PROTOCOL")
122108
.long("protocol")
@@ -274,6 +260,20 @@ pub fn define_command_line_options(mut app: Command) -> Command {
274260
.requires("ENCRYPT_METHOD")
275261
.help("Server address"),
276262
)
263+
.arg(
264+
Arg::new("UDP_ONLY")
265+
.short('u')
266+
.action(ArgAction::SetTrue)
267+
.conflicts_with("TCP_AND_UDP")
268+
.requires("LOCAL_ADDR")
269+
.help("Server mode UDP_ONLY"),
270+
)
271+
.arg(
272+
Arg::new("TCP_AND_UDP")
273+
.short('U')
274+
.action(ArgAction::SetTrue)
275+
.help("Server mode TCP_AND_UDP"),
276+
)
277277
}
278278
#[cfg(feature = "https-tunnel")]
279279
{
@@ -867,14 +867,16 @@ pub fn create(matches: &ArgMatches) -> ShadowsocksResult<(Runtime, impl Future<O
867867
}
868868
}
869869

870-
if matches.get_flag("UDP_ONLY") {
871-
local_config.mode = Mode::UdpOnly;
872-
}
870+
#[cfg(not(feature = "https-tunnel"))]
871+
{
872+
if matches.get_flag("UDP_ONLY") {
873+
local_config.mode = Mode::UdpOnly;
874+
}
873875

874-
if matches.get_flag("TCP_AND_UDP") {
875-
local_config.mode = Mode::TcpAndUdp;
876+
if matches.get_flag("TCP_AND_UDP") {
877+
local_config.mode = Mode::TcpAndUdp;
878+
}
876879
}
877-
878880
config.local.push(LocalInstanceConfig::with_local_config(local_config));
879881
}
880882

@@ -1051,6 +1053,8 @@ pub fn create(matches: &ArgMatches) -> ShadowsocksResult<(Runtime, impl Future<O
10511053
tokio::pin!(reload_task);
10521054
tokio::pin!(abort_signal);
10531055
tokio::pin!(server);
1056+
#[cfg(feature = "https-tunnel")]
1057+
info!("HTTPS Tunnel support enabled");
10541058

10551059
loop {
10561060
futures::select! {

0 commit comments

Comments
 (0)