Ahmed Elsayed
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
6 additions and
1 deletions
-
Cargo.toml
-
src/general_api.rs
|
|
@ -42,6 +42,7 @@ ipstack = { version = "0.1" } |
|
|
log = { version = "0.4", features = ["std"] } |
|
|
log = { version = "0.4", features = ["std"] } |
|
|
mimalloc = { version = "0.1", default-features = false, optional = true } |
|
|
mimalloc = { version = "0.1", default-features = false, optional = true } |
|
|
percent-encoding = "2" |
|
|
percent-encoding = "2" |
|
|
|
|
|
shlex = "1.3.0" |
|
|
socks5-impl = { version = "0.6", default-features = false, features = [ |
|
|
socks5-impl = { version = "0.6", default-features = false, features = [ |
|
|
"tokio", |
|
|
"tokio", |
|
|
] } |
|
|
] } |
|
|
|
|
|
@ -88,7 +88,11 @@ pub unsafe extern "C" fn tun2proxy_run_with_cli_args(cli_args: *const c_char, tu |
|
|
let Ok(cli_args) = std::ffi::CStr::from_ptr(cli_args).to_str() else { |
|
|
let Ok(cli_args) = std::ffi::CStr::from_ptr(cli_args).to_str() else { |
|
|
return -5; |
|
|
return -5; |
|
|
}; |
|
|
}; |
|
|
let args = <Args as ::clap::Parser>::parse_from(cli_args.split_whitespace()); |
|
|
let Some(args) = shlex::split(cli_args) else { |
|
|
|
|
|
log::error!("Failed to split CLI arguments"); |
|
|
|
|
|
return -6; |
|
|
|
|
|
}; |
|
|
|
|
|
let args = <Args as ::clap::Parser>::parse_from(args); |
|
|
general_run_for_api(args, tun_mtu, packet_information) |
|
|
general_run_for_api(args, tun_mtu, packet_information) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|