-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Proxy support in fetch function in tauri's http API #6467
Comments
I would also need to be able to set a proxy. But to be clear: this option should also to be available for the client you create via getClient() from "@tauri-apps/api/http" |
I think this design would be better
It would be even better if you could set the proxy type |
What types are there? And do you have an idea how it should look like api wise? On that topic, do you guys have examples from other libraries that support this and where you like the api design? |
if you use external Js modules, such as axios + socks-proxy-agent, that may be able to meet your needs. Unfortunately, it works in theory and has been verified in electron, but it does not work in tauri. |
I found that setting environment variables in the code is useful for tauri/http, but it has no effect for ajax std::env::set_var("HTTP_PROXY","http://127.0.0.1:7890");
std::env::set_var("HTTPS_PROXY","http://127.0.0.1:7890");
std::env::set_var("ALL_PROXY","http://127.0.0.1:7890"); |
On macOS, if you start the app with However, when the app is launched directly, it has no access to these environment variables. It should have respected macOS system proxy settings instead of relying on environment variables, just as other native apps do. |
This will be support in v2 in tauri-plugin-http, see tauri-apps/plugins-workspace#824 |
Describe the problem
There is no support for using proxies in fetch function in tauri's http API.
Describe the solution you'd like
Support proxies with and without authentication in fetch function in tauri's http API.
Proxy will be one of feth's function parameters, and could be passed with authentication data like: "username:password@host:port" or without authentication data: "host:port".
Example of fetch function call with proxy parameter:
const response = await fetch("https://www.google.com", { method: "GET", proxy: "admin:admin@123.123.321.321:8080" });
Alternatives considered
No response
Additional context
This feature is frequently needed when app includes some web scraping, I personally started coding my own project in Tauri, but lack of proxy supprort is blocking me right now from finishing the project :/
The text was updated successfully, but these errors were encountered: