-
Notifications
You must be signed in to change notification settings - Fork 666
Pass http proxy as env to command (fix #136, #117) #147
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
Conversation
Thank you @edvardchen for contribution. |
…ode-OpenSource#117) We use leetcode-cli and leetcode-cli uses request to call LeetCode web API. It's lucky that request respects the http proxy env variables(http_proxy, https_proxy), so all we need to do is passing proxy as env variable http_proxy to every command. TODO: do we need to set https_proxy for https request?
aeb2a04
to
e4cb64c
Compare
Yes. |
@edvardchen Awesome, I'll take a look later, thanks! |
Hi @edvardchen What will happen if we don't set https_proxy for https request |
request will use http_proxy as fallback |
Because vscode user setting doesn't have a https.proxy option, so we should not worry about it. |
src/utils/workspaceUtils.ts
Outdated
} | ||
|
||
// clone process.env and add http proxy | ||
export function createEnvOption(): {} { |
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.
Looks like cpUtils.ts is a better place to put this method?
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.
Sure. I'll move it there.
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.
LGTM
@edvardchen Thank you for your contribution! |
We use leetcode-cli and leetcode-cli uses request to call LeetCode web API.
It's lucky that request respects the http proxy env variables(http_proxy, https_proxy),
so all we need to do is passing proxy as env variable http_proxy to every command.
TODO: do we need to set https_proxy for https request?