Hide Xray console. Added lib.rs

This commit is contained in:
2025-12-26 03:48:57 +00:00
parent f5a4fc91e5
commit 9d76377053
2 changed files with 15 additions and 2 deletions

4
src/lib.rs Normal file
View File

@@ -0,0 +1,4 @@
pub mod config_models;
pub mod parser;
pub mod utils;
pub mod xray_runner;

View File

@@ -33,8 +33,17 @@ impl XrayRunner {
cmd.arg("-config")
.arg(&config_path)
.stdin(Stdio::null())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit());
.stdout(Stdio::null())
.stderr(Stdio::null());
// Hide console window on Windows
#[cfg(windows)]
{
const CREATE_NO_WINDOW: u32 = 0x08000000;
#[allow(unused_imports)]
use std::os::windows::process::CommandExt;
cmd.creation_flags(CREATE_NO_WINDOW);
}
let child = cmd.spawn()?;