mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-21 22:39:08 +00:00
Change order of operations to support auto setup
This commit is contained in:
parent
498a43b471
commit
a5db99b03b
1 changed files with 3 additions and 2 deletions
|
@ -113,16 +113,17 @@ pub async fn desktop_run_async(args: Args, shutdown_token: tokio_util::sync::Can
|
||||||
#[allow(unused_mut, unused_assignments, unused_variables)]
|
#[allow(unused_mut, unused_assignments, unused_variables)]
|
||||||
let mut setup = true;
|
let mut setup = true;
|
||||||
|
|
||||||
|
let device = tun2::create_as_async(&config)?;
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
setup = args.setup;
|
setup = args.setup;
|
||||||
if setup {
|
if setup {
|
||||||
|
log::trace!("Entering route setup");
|
||||||
tproxy_config::tproxy_setup(&tproxy_args)?;
|
tproxy_config::tproxy_setup(&tproxy_args)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let device = tun2::create_as_async(&config)?;
|
|
||||||
|
|
||||||
#[cfg(any(target_os = "windows", target_os = "macos"))]
|
#[cfg(any(target_os = "windows", target_os = "macos"))]
|
||||||
if setup {
|
if setup {
|
||||||
tproxy_config::tproxy_setup(&tproxy_args)?;
|
tproxy_config::tproxy_setup(&tproxy_args)?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue