Skip to content

Commit

Permalink
fix: Unspecified proxy lookup on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Jul 14, 2023
1 parent b1029bb commit f8249d7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src-tauri/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,14 @@ pub fn create_background_window() {

#[tauri::command]
pub fn set_proxy(proxy: &str) -> Result<(), ()> {
std::env::set_var("http_proxy", proxy);
std::env::set_var("https_proxy", proxy);
std::env::set_var("all_proxy", proxy);
if proxy.is_empty(){
std::env::remove_var("http_proxy");
std::env::remove_var("https_proxy");
std::env::remove_var("all_proxy");
}else{
std::env::set_var("http_proxy", proxy);
std::env::set_var("https_proxy", proxy);
std::env::set_var("all_proxy", proxy);
}
Ok(())
}

0 comments on commit f8249d7

Please sign in to comment.