File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use std:: io;
4
4
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 } ;
7
7
8
8
/// Starts a UDP local server
9
9
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 ! ( ) ,
13
16
}
14
17
}
Original file line number Diff line number Diff line change @@ -51,9 +51,10 @@ use std::time::Duration;
51
51
52
52
pub mod client;
53
53
pub mod local;
54
+ mod redir_local;
54
55
pub mod server;
55
- pub ( crate ) mod socks5_local;
56
- pub ( crate ) mod tunnel_local;
56
+ mod socks5_local;
57
+ mod tunnel_local;
57
58
mod utils;
58
59
59
60
mod crypto_io;
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments