1
Fork 0
mirror of https://github.com/redstrate/LauncherTweaks.git synced 2025-05-20 17:37:46 +00:00
launchertweaks/src/config.rs
Joshua Goins 7cc86c38b0 Add feature to force WinHTTP traffic to the system proxy
This is useful for sniffing non-web browser launcher traffic that goes
through WinHTTP. Thanks to NotNite for the initial hooking code.

Also when no launcher URL is configured, it should fall back to the
official URL now.
2025-04-20 11:43:19 -04:00

15 lines
405 B
Rust

use serde::Deserialize;
#[derive(Deserialize, Default)]
pub struct Config {
pub launcher_url: Option<String>,
pub winhttp_proxy: Option<String>,
}
pub fn get_config() -> Config {
std::env::current_exe()
.ok()
.and_then(|p| std::fs::read_to_string(p.join("../launchertweaks.toml")).ok())
.and_then(|s| toml::from_str::<Config>(&s).ok())
.unwrap_or_default()
}