Skip to content

Commit 8ec7633

Browse files
committed
[#190] UDP Transparent proxy placeholder
1 parent d775f70 commit 8ec7633

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/relay/udprelay/local.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
33
use std::io;
44

5-
use super::{socks5_local, tunnel_local};
6-
use crate::context::SharedContext;
5+
use super::{redir_local, socks5_local, tunnel_local};
6+
use crate::{config::ConfigType, context::SharedContext};
77

88
/// Starts a UDP local server
99
pub async fn run(context: SharedContext) -> io::Result<()> {
10-
match context.config().forward {
11-
Some(..) => tunnel_local::run(context).await,
12-
None => socks5_local::run(context).await,
10+
match context.config().config_type {
11+
ConfigType::TunnelLocal => tunnel_local::run(context).await,
12+
ConfigType::Socks5Local => socks5_local::run(context).await,
13+
ConfigType::RedirLocal => redir_local::run(context).await,
14+
ConfigType::HttpLocal => unreachable!(),
15+
ConfigType::Server => unreachable!(),
1316
}
1417
}

src/relay/udprelay/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ use std::time::Duration;
5151

5252
pub mod client;
5353
pub mod local;
54+
mod redir_local;
5455
pub mod server;
55-
pub(crate) mod socks5_local;
56-
pub(crate) mod tunnel_local;
56+
mod socks5_local;
57+
mod tunnel_local;
5758
mod utils;
5859

5960
mod crypto_io;

src/relay/udprelay/redir_local.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use std::io;
2+
3+
use crate::context::SharedContext;
4+
5+
/// Starts a UDP local server
6+
pub async fn run(_: SharedContext) -> io::Result<()> {
7+
unimplemented!("UDP Transparent Proxy (redir) isn't implemented yet");
8+
}

0 commit comments

Comments
 (0)