an-anime-team / anime-launcher-sdk

Anime Game Launcher development SDK
GNU General Public License v3.0
17 stars 19 forks source link

repect proxy envs #2

Closed tkkcc closed 1 year ago

tkkcc commented 1 year ago

I can't download wine in the rail launcher, got "the timeout of the request was reached" popup.

  2023-05-10T04:35:53.129663Z  INFO honkers_railway_launcher::ui::first_run::download_components: Installing wine: lutris-GE-Proton8-4-x86_64
    at src/ui/first_run/download_components.rs:375

  2023-05-10T04:35:53.130642Z TRACE minreq::connection: Setting up TLS parameters for github.com.
    at /home/bilabila/.cargo/registry/src/github.com-1ecc6299db9ec823/minreq-2.7.0/src/connection.rs:167

  2023-05-10T04:35:53.150142Z TRACE minreq::connection: Establishing TCP connection to github.com.
    at /home/bilabila/.cargo/registry/src/github.com-1ecc6299db9ec823/minreq-2.7.0/src/connection.rs:175

  2023-05-10T04:35:57.136837Z ERROR honkers_railway_launcher::ui::first_run::download_components: Failed to initialize wine installer: the timeout of the request was reached
    at src/ui/first_run/download_components.rs:432

  2023-05-10T04:35:57.164118Z DEBUG honkers_railway_launcher::ui::first_run::main: Called first run window event: Toast { title: "Failed to install wine", description: Some("the timeout of the request was reached") }
    at src/ui/first_run/main.rs:179
    in relm4::component::sync::builder::update_with_view with input: Toast { title: "Failed to install wine", description: Some("the timeout of the request was reached") }, component: "honkers_railway_launcher::ui::first_run::main::FirstRunApp", id: "0x7fff820349f8"

Because github.com is slow and sometimes blocked in china, some of us use proxy tools, and set proxy envs. Most cmd and gui linux apps respect proxy envs out of box, like curl, wget, git, chromium, vscode. I suggest this sdk setup proxy config for minreq, or switching to reqwest, which respect proxy envs by default.

krypt0nn commented 1 year ago

It's part of the core library but noted. Will be integrated in the next launcher update

krypt0nn commented 1 year ago

I've made a merge request in minreq repo. If it will be merged, I won't need to update core & sdk a lot. Let's wait and see

krypt0nn commented 1 year ago

So seems minreq dev is unlikely to merge my changes, so I'll need to implement them in the core library instead. Not a big deal, though

krypt0nn commented 1 year ago

Done. My merge request in minreq repo was approved: https://github.com/neonmoe/minreq/commit/d3745f52bb84b51ee5e4376f2f80b81ef6bbedfe

Await environment variables support in future updates