Open lindongchen opened 6 days ago
This one is rather curious, I did some digging and here are some characteristics I've found so far:
wry
's proxy support does work on Windows 11 for both http and socks5, building a window using wry
with with_proxy_config
totally works.proxyUrl
argument using tauri
will immediately result in the window spawning and closing.tauri
isn't closed properly, as crash callback isn't raised and additional attempt at creating the same window after the first one closes will result in the error "a webview with label my-label
already exists".https://github.com/tauri-apps/wry/pull/1006/files#diff-7134ef3789fee9def2afb1d6196ed5eff5f37b7bbad5eceaa5d85cbf3e3513de Yeah , I have reviewed wry's code and added socks5 and HTTP proxies for webview2
I can use new Windows into new Webview separately without using WebviewWindow. It works and not crashing, but the proxy is still invalid
I think just https://github.com/tauri-apps/tauri/blob/dev/core/tauri/src/webview/plugin.rs#WebViewConfig
missing proxy_url definition
#[command]
async fn create_wry_webview(
app: tauri::AppHandle,
label: String,
window_label: String,
proxy_host: String,
proxy_port: String,
curl: String,
) -> Result<(),()> {
unsafe {
let window = app
.get_window(&window_label)
.expect("Failed to find window by label");
let proxy_config = wry::ProxyConfig::Socks5(wry::ProxyEndpoint {
host: proxy_host,
port: proxy_port
});
let builder = wry::WebViewBuilder::new_as_child(&window);
let webview = builder
.with_url(curl)
.with_proxy_config(proxy_config)
.with_bounds(wry::Rect {
position: tauri::LogicalPosition::new(100, 100).into(),
size: tauri::LogicalSize::new(960, 800).into(),
})
.build()
.unwrap();
}
Ok(())
}
import { getCurrent,Window } from '@tauri-apps/api/window'
import { invoke } from '@tauri-apps/api/core';
...
options.parent = getCurrent();
const appWindow = new Window(`${app.name}-window`,options);
appWindow.once('tauri://created', function () {
invoke('create_wry_webview', {
windowLabel:`xxx-window`,
label:`xxx-webview`,
curl:'https://chatgpt.com/',
proxyHost: '127.0.0.1',
proxyPort: `1234`
});
});
@dklassic When I tried to create a webview using wry(0.41.0)
and set "with_proxy_config
", I opened a blank window while running Win11. After a while, the window froze (it didn't immediately froze, it froze for a few seconds), and I ruled out other reasons. The froze was caused by with_proxy_config,
So with_proxy_config not working and caused the window to freeze
Cloud you help me check the code issue? Thanks
Describe the bug
The following seems to be compatibility issues, which have been verified by macos 14 and are effective 1. webview sock5 proxy_url not activate on windows 11, but macos 14 is activated. Is it still not supported, or is there a special configuration for the windows plm.
Reproduction
No response
Expected behavior
Confirm support and plan
Full
tauri info
outputStack trace
No response
Additional context
No response