Skip to content

[bug] proxy_url not working on Windows when used with additional_browser_args #14155

@Borber

Description

@Borber

Describe the bug

WebviewWindowBuilder.proxy_url(proxy_url) is not working on Windows

Reproduction

The behavior of proxy_url is very strange, here is my summary:

First, I wrote my own http proxy server (A) to proxy plaintext http requests and perform some operations on them, while directly forwarding https requests. Its address is: http://127.0.0.1:5380

On MacOS, I conducted the following tests on proxy_url:

  1. I set proxy_url to http://127.0.0.1:5380, and my proxy server A could normally receive this request and process it
  2. I set proxy_url to http://127.0.0.1:3000 (in fact, this port doesn't do anything), theoretically the webview should not be able to access web pages, but it can still normally request web pages on the internet.

On Windows, I conducted the following tests on proxy_url:

  1. I set proxy_url to http://127.0.0.1:5380, the webview's request was not sent to proxy server A, it seemed to directly access the internet, just like test 2 on MacOS.

At the same time, on MacOS, I also tested with other proxy software (sparkle a clash proxy software that provides local http proxy service), and some strange phenomena also occurred:

  1. I used curl -x http://127.0.0.1:7890 https://google.com to access normally and left log records on clash
  2. When I set http://127.0.0.1:7890 as proxy_url, the request did not leave log records on clash, it seemed to be completely ignored, which is also a point of confusion for me, why my own http proxy server can work normally, but clash cannot.

Expected behavior

  1. proxy_url works normally on Windows
  2. When the URL set in proxy_url theoretically cannot provide normal http proxy service, webview should not be able to continue accessing the internet
  3. (Optional) If curl -x [proxy_url] can be used, tauri proxy_url should also be used (I know this is probably related to webview itself, but this situation feels very strange)

Full tauri info output

MacOS:

❯ bun tauri info
$ tauri info

[✔] Environment
    - OS: Mac OS 15.6.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.91.0-nightly (c8ca44c98 2025-08-10)
    ✔ cargo: 1.91.0-nightly (840b83a10 2025-07-30)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: nightly-aarch64-apple-darwin (default)
    - node: 22.19.0
    - npm: 10.9.3
    - bun: 1.2.20
    - deno: deno 2.4.4

[-] Packages
    - tauri 🦀: 2.8.5
    - tauri-build 🦀: 2.4.1
    - wry 🦀: 0.53.3
    - tao 🦀: 0.34.3
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.4.1 (outdated, latest: 2.8.4)

[-] Plugins

[-] App
    - build-type: bundle
    - CSP: default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; img-src 'self' data: blob: https: http:; media-src 'self' data: blob: mediastream: https: http:; connect-src 'self' ws: wss: http: https: data: blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; style-src 'self' 'unsafe-inline' data: blob:; frame-src 'self' data: blob: https: http:; child-src 'self' data: blob:; object-src 'self' data: blob:; font-src 'self' data: blob:;
    - frontendDist: ../ui/dist
    - devUrl: http://localhost:5173/
    - bundler: Vite

[-] iOS
    - Developer Teams: BORBER X (ID: NDC4NBM36S), du li (ID: XD5QWLK4LS)

Windows:

$ tauri info

[✔] Environment
    - OS: Windows 10.0.19044 x86_64 (X64)
    ✔ WebView2: 139.0.3405.125
    ✔ MSVC: Visual Studio Professional 2019
    ✔ rustc: 1.89.0-nightly (414482f6a 2025-05-13)
    ✔ cargo: 1.89.0-nightly (056f5f4f3 2025-05-09)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (default)
    - node: 22.15.0
    - npm: 10.9.2
    - bun: 1.2.13

[-] Packages
    - tauri 🦀: 2.8.3, (outdated, latest: 2.8.5)
    - tauri-build 🦀: 2.4.0, (outdated, latest: 2.4.1)
    - wry 🦀: 0.53.1, (outdated, latest: 0.53.3)
    - tao 🦀: 0.34.2, (outdated, latest: 0.34.3)
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.4.1 (outdated, latest: 2.8.4)

[-] Plugins

[-] App
    - build-type: bundle
    - CSP: default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; img-src 'self' data: blob: https: http:; media-src 'self' data: blob: mediastream: https: http:; connect-src 'self' ws: wss: http: https: data: blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:; style-src 'self' 'unsafe-inline' data: blob:; frame-src 'self' data: blob: https: http:; child-src 'self' data: blob:; object-src 'self' data: blob:; font-src 'self' data: blob:;
    - frontendDist: ../ui/dist
    - devUrl: http://localhost:5173/
    - bundler: Vite

Stack trace


Additional context

And I need to clarify that the same code was working correctly with Windows proxy_url two months ago. I've attached the old_Cargo.lock.txt from the CI build at that time, and also the new_Cargo.lock.txt which is not working properly now.

old_Cargo.lock.txt

new_Cargo.lock.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions