mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-23 01:20:52 +00:00
IPv6 enabled
This commit is contained in:
parent
e518355756
commit
d7861128f4
3 changed files with 24 additions and 9 deletions
16
src/main.rs
16
src/main.rs
|
@ -29,6 +29,14 @@ struct Args {
|
|||
#[arg(short, long, value_name = "method", value_enum, default_value = "virtual")]
|
||||
dns: ArgDns,
|
||||
|
||||
/// Enable DNS over TCP
|
||||
#[arg(long)]
|
||||
dns_over_tcp: bool,
|
||||
|
||||
/// IPv6 enabled
|
||||
#[arg(short = '6', long)]
|
||||
ipv6_enabled: bool,
|
||||
|
||||
/// Routing and system setup
|
||||
#[arg(short, long, value_name = "method", value_enum)]
|
||||
setup: Option<ArgSetup>,
|
||||
|
@ -40,10 +48,6 @@ struct Args {
|
|||
/// Verbosity level
|
||||
#[arg(short, long, value_name = "level", value_enum, default_value = "info")]
|
||||
verbosity: ArgVerbosity,
|
||||
|
||||
/// Enable DNS over TCP
|
||||
#[arg(long)]
|
||||
dns_over_tcp: bool,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)]
|
||||
|
@ -87,6 +91,10 @@ fn main() -> ExitCode {
|
|||
options = options.with_dns_over_tcp();
|
||||
}
|
||||
|
||||
if args.ipv6_enabled {
|
||||
options = options.with_ipv6();
|
||||
}
|
||||
|
||||
let interface = match args.tun_fd {
|
||||
None => NetworkInterface::Named(args.tun.clone()),
|
||||
Some(fd) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue