Skip to content

Conversation

@topshihun
Copy link

Issue Link: #261

Changed files:

wiki-api/cargo.toml:

  • Add feature "socks" for reqwest.

src/cli.rs:

  • Add proxy: Option<String> for Cli struct.
  • Add 'warn_list: Vec' for CliResults, because it can't use tracing and log when match cli and the operation of initial proxy maybe failed.
  • Add proxy initial code in match_cli().

src/main.rs:

  • Add code for warning CliResults.warn_list.

new file: wiki-api/src/proxy.rs

  • static proxy: OnceLock<Proxy>: ensure proxy.
  • 'fn validate_proxy` : check proxy address.
  • pub fn init_proxy: initial proxy and it can only be used once.
  • pub fn get_proxy: get proxy.

wiki-api/page.rs and wiki-api/search.rs

  • replace Client::new to Client::builder and add proxy setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant