mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-22 06:49: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)]
|
||||
let mut setup = true;
|
||||
|
||||
let device = tun2::create_as_async(&config)?;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
setup = args.setup;
|
||||
if setup {
|
||||
log::trace!("Entering route setup");
|
||||
tproxy_config::tproxy_setup(&tproxy_args)?;
|
||||
}
|
||||
}
|
||||
|
||||
let device = tun2::create_as_async(&config)?;
|
||||
|
||||
#[cfg(any(target_os = "windows", target_os = "macos"))]
|
||||
if setup {
|
||||
tproxy_config::tproxy_setup(&tproxy_args)?;
|
||||
|
|
Loading…
Add table
Reference in a new issue