Watfaq / clash-rs

custom protocol network proxy
https://watfaq.gitbook.io/clashrs-user-manual/
Apache License 2.0
709 stars 54 forks source link

Have tun support multiple address #579

Open ibigbug opened 1 week ago

ibigbug commented 1 week ago

The rust tun only take one address now. We'll need both v4 and v6 address to add static route on windows

VendettaReborn commented 1 week ago

rust-tun and wintun don't support settings of ipv6 addr yet, and since hard to push this feature to upstreams(at least might take plenty of time), we may extend the Device trait now, maybe in our repo, maybe in a separate crate? here is the work-around on each platform

ibigbug commented 1 week ago

yeah wintun is a bit weird it does take v6 address but doesn't expose it https://github.com/nulldotblack/wintun/blob/main/src/adapter.rs#L306

i think we can fork the rust-tun(or tun2?) and add v6 support in a separate repo and try to add it back to the upstream after we validated it's working

VendettaReborn commented 1 week ago

oh, i forgot that we are currently using the forked rust-tun. yeah, that's workable

xmh0511 commented 1 week ago

Welcome to use tun-rs, which is actively maintained.