bin: boundif option
This commit is contained in:
@@ -38,7 +38,7 @@ socks-port = 1080
|
||||
Direct = direct
|
||||
```
|
||||
|
||||
More configuration examples can be found [here](https://github.com/eycorsican/leaf/blob/master/README.zh.md).
|
||||
More configuration examples can be found [here](https://github.com/eycorsican/leaf/blob/master/README.zh.md). If you want more flexible control on the config options, the JSON format should be used, up-to-date examples for the JSON format could be found in the [tests](https://github.com/eycorsican/leaf/blob/master/leaf/tests), both client-side and server-side config examples are presented there.
|
||||
|
||||
## TUN Mode and Gateway Mode
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ struct Args {
|
||||
#[argh(option, short = 't')]
|
||||
test_outbound: Option<String>,
|
||||
|
||||
/// bound interface, explicitly sets the OUTBOUND_INTERFACE environment variable
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
#[argh(option, short = 'b')]
|
||||
boundif: Option<String>,
|
||||
|
||||
/// prints version
|
||||
#[argh(switch, short = 'V')]
|
||||
version: bool,
|
||||
@@ -75,6 +80,11 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||
if let Some(iface) = args.boundif {
|
||||
std::env::set_var("OUTBOUND_INTERFACE", &iface);
|
||||
}
|
||||
|
||||
if let Some(tag) = args.test_outbound {
|
||||
let config = leaf::config::from_file(&args.config).unwrap();
|
||||
let rt = tokio::runtime::Builder::new_current_thread()
|
||||
|
||||
Reference in New Issue
Block a user