tauri: How to make tauri use http://tauri.localhost/ instead of https://tauri.localhost/ ? The page was blocked since the page was loaded over HTTPS.
Updated @2023-09-17: If anyone has encountered this problem, please pay attention to this PR: Allow http origin on Windows
Is your feature request related to a problem? Please describe.
WebView console shows the following errors when we connect to endpoint ‘ws:<URL>/’:
Mixed Content: The page at '<URL>' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws:<URL>/'. This request has been blocked; this endpoint must be available over WSS.
Describe the solution you’d like We should allow to set an option in tauri.conf.json to use http://tauri.localhost/ instead of https://tauri.localhost/.
Describe alternatives you’ve considered None.
Additional context
- We can NOT use WSS for historical reasons. 2) WS works fine on macOS, but does NOT works on Windows.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 58 (18 by maintainers)
Any fix for this yet? Or we have to use localhost plugin?
cargo tauri info:
The WebView console shows the following errors:
Maybe the API looks like this:
i change the
tauri.conf.json > tauri > security > dangerousUseHttpScheme = true,then it workI met the same problem too. I don’t fetch
http protocol request, It always responst status = 400 and the service is not receive request.I met the same problem.Because of historical reasons can not support wss,in this case windows compiler software becomes unusable, which should be a common situation.
hi, @lucasfernog
This plugin needs my local yarn start the app and keep it running? I found that the source code can only run localhost, and I can’t use other particular ip as a parameter?
Unfortunately we need the
https://tauri.localhostURL to have a secure context enabled. Maybe this is a case where using a localhost is better. https://github.com/tauri-apps/tauri-plugin-localhost/