Add proxy support to Updater and UpdaterBuilder#370
Open
LeeeSe wants to merge 1 commit intocrabnebula-dev:mainfrom
Open
Add proxy support to Updater and UpdaterBuilder#370LeeeSe wants to merge 1 commit intocrabnebula-dev:mainfrom
LeeeSe wants to merge 1 commit intocrabnebula-dev:mainfrom
Conversation
Contributor
|
Thanks for the proposal. I feel at the very least, that this will absolutely need some kind of documentary support, ie. over at https://docs.crabnebula.dev/packager/ |
Author
|
Sorry, my description was incorrect. Actually, I just added a proxy parameter for the updater, providing users with an option to set a proxy address for their own app. It's not that I set a switch for the updater that, when turned on, automatically uses the system proxy. Its usage is as follows: use cargo_packager_updater::{UpdaterBuilder, Config};
use semver::Version;
let config = Config {
endpoints: vec!["http://myserver.com/updates".parse().unwrap()],
pubkey: "<pubkey here>".into(),
..Default::default()
};
let current_version = Version::parse("0.1.0").unwrap();
let updater = UpdaterBuilder::new(current_version, config)
.proxy("http://your-proxy-address:port") // set your proxy url
.build()
.unwrap();
if let Some(update) = updater.check().expect("failed while checking for update") {
update.download_and_install().expect("failed to download and install update");
}If you think this small change needs to be documented on the doc, I'm willing to do so. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add proxy support to Updater and UpdaterBuilder.
When a binary is packaged as an app and runs on Mac, cargo packager updater doesn't automatically use a proxy to check for and download updates. I've added a proxy configuration option to UpdaterBuilder to enable automatic use of system proxy (optional).