-
-
Notifications
You must be signed in to change notification settings - Fork 154
feat(network): add proxy setting for updater #259
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
base: main
Are you sure you want to change the base?
Conversation
- Add proxyUrl to app settings + Network tab\n- Pass proxy to plugin-updater check()\n- Enable reqwest socks feature for socks5 proxy URLs
733212b to
5bc6ab2
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Wait why do you want to proxy the updater? Seems dangerous? |
|
Anyone could setup a proxy update for you (with physical access to ur computer) and send a comprised update no? |
Because of network issues, the network can’t directly access this update URL unless I enable Clash’s global TUN mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edd35a2ba4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| setState({ stage: "checking" }); | ||
| update = await check(); | ||
| const trimmedProxyUrl = proxyUrl?.trim() ?? ""; | ||
| update = await check(trimmedProxyUrl ? { proxy: trimmedProxyUrl } : undefined); | ||
| if (!update) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-check update after proxy changes before download
The proxy is only applied in the check() call (plugin-updater’s CheckOptions is the only place that accepts a proxy; download/downloadAndInstall don’t take one), so if an update was already cached and the user changes the proxy, startUpdate will reuse the old Update instance and download with the previous proxy. This can cause downloads to keep failing behind a proxy unless the user manually re-checks; consider clearing updateRef or forcing a re-check whenever proxyUrl changes.
Useful? React with 👍 / 👎.
Adds a Network settings page to configure a proxy URL used by the updater.
Currently only applied to updater requests; can be reused for other outbound requests later.