mirror of
https://github.com/redstrate/LauncherTweaks.git
synced 2025-05-20 17:37:46 +00:00
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.
15 lines
405 B
Rust
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()
|
|
}
|