Skip to content

[FEAT] Allow specify global proxy with environment variable for backend #4358

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TTsdzb
Copy link

@TTsdzb TTsdzb commented Feb 27, 2025

Allow the user to specify a proxy server for backend requests (the ones using axios) with normal proxy envs like http_proxy, https_proxy or all_proxy.

This allows the user to specify a global proxy server for making requests. Provides a solution for #3085. This is essential for some poorly routed or DNS polluted area (like Mainland China), where users may have trouble connecting to Github or game stores, or have really poor download speed. In this case they have to use a proxy server to get them work.

This may not be the best solution but should be the simplest one.

I've tested Wine installation and it works fine. However when I tried to login, it fails with following error. I think I'm missing some relevant toolsets, and since this also happens before I make these changes, I assume it's not caused by my changes. Please let me know if I'm missing something or you get into any problem.

Error running command "LEGENDARY_CONFIG_PATH=/home/liusq/.config/heroic/legendaryConfig/legendary /tmp/.mount_Heroic3PInp1/resources/app.asar.unpacked/build/bin/x64/linux/legendary auth --code <redacted>": Error: spawn ./legendary ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at processTicksAndRejections (node:internal/process/task_queues:82:21)

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@flavioislima
Copy link
Member

flavioislima commented Feb 27, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@TTsdzb
Copy link
Author

TTsdzb commented Feb 27, 2025

I have read the CLA Document and I hereby sign the CLA

@TTsdzb TTsdzb changed the title [FEAT] Allow specify global proxy with environment variable [FEAT] Allow specify global proxy with environment variable for backend Mar 28, 2025
@arielj
Copy link
Collaborator

arielj commented Mar 28, 2025

However when I tried to login, it fails with following error. I think I'm missing some relevant toolsets, and since this also happens before I make these changes, I assume it's not caused by my changes. Please let me know if I'm missing something or you get into any problem.

Error running command "LEGENDARY_CONFIG_PATH=/home/liusq/.config/heroic/legendaryConfig/legendary /tmp/.mount_Heroic3PInp1/resources/app.asar.unpacked/build/bin/x64/linux/legendary auth --code <redacted>": Error: spawn ./legendary ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at processTicksAndRejections (node:internal/process/task_queues:82:21)

looks like you are missing the binaries? are you generating an app image? make sure you run pnpm download-helper-binaries first, and you don't really need to generate an app image to test things locally though if you are doing that

Allow the user to specify a proxy server for backend requests with `GLOBAL_AGENT_HTTP_PROXY`.
Use standard proxy environment variables when given, instead of
customized ones by the lib.
@TTsdzb
Copy link
Author

TTsdzb commented Mar 29, 2025

make sure you run pnpm download-helper-binaries first

This make everything works, thanks. It works smoothly for me and I think it's ready for review now.

@TTsdzb
Copy link
Author

TTsdzb commented Mar 29, 2025

Btw, debugging with pnpm start needs these binaries to be downloaded, too. Could you guys please mention it in the README.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants