mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-20 22:09:09 +00:00
android issues
This commit is contained in:
parent
97c4aa5137
commit
2b3463c55c
2 changed files with 5 additions and 2 deletions
|
@ -2,4 +2,4 @@
|
||||||
protocol = "sparse"
|
protocol = "sparse"
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
#target = ["x86_64-unknown-linux-gnu"]
|
# target = ["x86_64-unknown-linux-gnu", "aarch64-linux-android"]
|
||||||
|
|
|
@ -20,6 +20,7 @@ pub unsafe extern "C" fn Java_com_github_shadowsocks_bg_Tun2proxy_run(
|
||||||
tun_fd: jint,
|
tun_fd: jint,
|
||||||
tun_mtu: jint,
|
tun_mtu: jint,
|
||||||
verbose: jboolean,
|
verbose: jboolean,
|
||||||
|
dns_over_tcp: jboolean,
|
||||||
) -> jint {
|
) -> jint {
|
||||||
let log_level = if verbose != 0 { "trace" } else { "info" };
|
let log_level = if verbose != 0 { "trace" } else { "info" };
|
||||||
let filter_str = &format!("off,tun2proxy={log_level}");
|
let filter_str = &format!("off,tun2proxy={log_level}");
|
||||||
|
@ -39,7 +40,9 @@ pub unsafe extern "C" fn Java_com_github_shadowsocks_bg_Tun2proxy_run(
|
||||||
let proxy_type = proxy.proxy_type;
|
let proxy_type = proxy.proxy_type;
|
||||||
log::info!("Proxy {proxy_type} server: {addr}");
|
log::info!("Proxy {proxy_type} server: {addr}");
|
||||||
|
|
||||||
let options = Options::new().with_virtual_dns().with_mtu(tun_mtu as usize);
|
let dns_addr = "8.8.8.8".parse::<std::net::IpAddr>().unwrap();
|
||||||
|
let options = Options::new().with_dns_addr(Some(dns_addr)).with_mtu(tun_mtu as usize);
|
||||||
|
let options = if dns_over_tcp != 0 { options.with_dns_over_tcp() } else { options };
|
||||||
|
|
||||||
let interface = NetworkInterface::Fd(tun_fd);
|
let interface = NetworkInterface::Fd(tun_fd);
|
||||||
let tun2proxy = tun_to_proxy(&interface, &proxy, options)?;
|
let tun2proxy = tun_to_proxy(&interface, &proxy, options)?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue