Repository: tauri
Issue: [bug] Tauri v2 on Ubuntu does not automatically use system proxy, unlike v1
Labels: type: bug,platform: Linux,status: needs triage

### Describe the bug

In Tauri v2 running on Ubuntu, the system proxy is not automatically detected or used, while Tauri v1 automatically uses the system proxy under the same conditions.

Additionally, both Tauri v1 and v2 work as expected on Windows, the system proxy is automatically used.

I found the workaround for Tauri v2 by setting the `proxyUrl` in the `tauri.conf.json` to the system proxy address.
https://v2.tauri.app/reference/config/#proxyurl
This allowed the application to use the proxy. 
However, there are several downsides to this manual configuration:
1. If the system proxy changes during the runtime of the application, the proxy does not switch automatically, causing potential network issues.
2. It requires the user to know their system's proxy address and configure it manually, which raises the barrier for non-technical users.

When `proxyUrl` is set to `null`, the application in **Tauri v2 on Ubuntu** does not use any proxy at all. There is no option for **Tauri v2 on Ubuntu** to automatically detect and use the system proxy without manual configuration.

This issue was discovered when I was trying to solve #11238

### Reproduction

Follow these steps to reproduce the issue on **Ubuntu 22.04**:
 
1. Create a new Tauri project:


```bash
pnpm create tauri-app@latest
✔ Project name · tauri-app
✔ Identifier · com.tauri-app.app
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, bun)
✔ Choose your package manager · pnpm
✔ Choose your UI template · Vanilla
✔ Choose your UI flavor · TypeScript
```
 
2. Install dependencies:


```bash
cd tauri-app
pnpm install
```
 
3. Modify the `lib.rs`

```rust
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_shell::init())
        .invoke_handler(tauri::generate_handler![greet])
        .setup(|app| {
            let window = app.get_webview_window("main").unwrap();
            window.open_devtools();
            window.eval("window.location.replace('https://tauri.app/')")?;
            Ok(())
        })
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
```
 
4. Set your system proxy. In my case, I used the proxy `http://127.0.0.1:7890`.
 
![image](https://github.com/user-attachments/assets/a2565aa8-6314-43b9-8cfc-8579620bb52e)

5. Run the application:


```bash
pnpm tauri dev
```
 
6. You will encounter the following error:
 
![image](https://github.com/user-attachments/assets/1ca67886-1a0c-440e-ad7e-eccd9fc71ee2)

7. To resolve the issue, set the `proxyUrl` in `tauri.conf.json` as follows:

```json
"app": {
  "withGlobalTauri": true,
  "windows": [
    {
      "title": "tauri-app",
      "width": 800,
      "height": 600,
      "proxyUrl": "http://127.0.0.1:7890"
    }
  ],
  "security": {
    "csp": null
  }
},
```

### Expected behavior

**Tauri v2 on Ubuntu** should automatically use the system proxy, just like Tauri v1 do on Ubuntu, and how both Tauri v1 and v2 do on Windows. 
The main problem is that there is currently no way for **Tauri v2 on Ubuntu** to automatically detect and use the system proxy. Instead, Tauri v2 on Ubuntu either completely ignores the proxy or requires manual configuration, which is not ideal.

### Full `tauri info` output

```text
[✔] Environment
    - OS: Linux Mint 21.2.0 x86_64 (X64)
    ✔ webkit2gtk-4.1: 2.44.2
    ✔ rsvg2: 2.52.5
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 18.18.0
    - pnpm: 9.9.0
    - yarn: 1.22.19
    - npm: 9.8.1

[-] Packages
    - tauri 🦀: 2.0.1
    - tauri-build 🦀: 2.0.1
    - wry 🦀: 0.44.1
    - tao 🦀: 0.30.3
    - @tauri-apps/api : 2.0.1
    - @tauri-apps/cli : 2.0.1

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.1
    - @tauri-apps/plugin-shell : 2.0.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite
```


### Stack trace

_No response_

### Additional context

_No response_