Skip to content
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

config http.proxy in workspace settings #236932

Closed
chesha1 opened this issue Dec 25, 2024 · 6 comments
Closed

config http.proxy in workspace settings #236932

chesha1 opened this issue Dec 25, 2024 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug proxy Issues regarding network proxies
Milestone

Comments

@chesha1
Copy link

chesha1 commented Dec 25, 2024

The http.proxy setting can only be configured in user settings. I’m wondering if it’s possible to set it in workspace settings instead.

When using a dev container, the http.proxy setting is passed to the container. However, the container cannot use the proxy on the local machine unless additional configuration is done.

If http.proxy could be configured directly in .vscode/settings.json or .devcontainer/devcontainer.json, it would make things much easier for users. Currently, we have to either modify the user settings each time or set up a more complex container network configuration.

@chrmarti chrmarti added feature-request Request for new features or functionality proxy Issues regarding network proxies labels Jan 8, 2025
@vs-code-engineering vs-code-engineering bot added this to the Backlog Candidates milestone Jan 8, 2025
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@chrmarti
Copy link
Collaborator

chrmarti commented Jan 8, 2025

With a proxy running on localhost, how would you set http.proxy to fix it in the container? If you use the host's ip address in the Docker network, you still need to configure the proxy to also listen on that interface. Is there a simpler approach? (Looking for ways to make this work without the need for user configuration.)

@chesha1
Copy link
Author

chesha1 commented Jan 8, 2025

@chrmarti Thank you for your reply. I might have misunderstood your point. Are you saying that both the local machine and the dev container need to use the proxy, so setting http.proxy in the user settings won't help?

I think I didn't express myself clearly. Here's my situation: I have to run a proxy to overcome some network issues, but dev containers are sometimes hosted in environments where the network works fine without a proxy, such as in Codespaces. So if http.proxy could be set to an empty string through settings.json in the dev container, while retaining http://localhost:xxxx elsewhere, that would be great. The dev container and the local machine don't always need the same proxy.

@chrmarti
Copy link
Collaborator

chrmarti commented Jan 8, 2025

We ignore the proxy setting from the local OS when connected via Remote-SSH. We should ignore the local http.proxy setting in that case too. As a workaround you could try to configure your proxy in the OS instead of the http.proxy setting.

It would make sense for http.proxy to be overridable in the machine settings. (Workspace settings might be the wrong scope, but maybe there are cases where having different proxies per workspace too.)

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Jan 8, 2025
@chrmarti chrmarti modified the milestones: Backlog Candidates, Backlog Jan 8, 2025
@davidolrik
Copy link

Having it in Workspace settings would be super useful.

@chrmarti
Copy link
Collaborator

chrmarti commented Feb 21, 2025

You can now set https.proxy in the machine settings. Note that the http.useLocalProxyConfiguration machine setting controls whether or not the proxy config from the machine settings is applied (Remote-SSH and Remote Tunnels use the machine proxy settings by default, WSL and Dev Containers use the local proxy settings by default).

Resolved with microsoft/vscode-copilot-release#3821. This is available in VS Code 1.97.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug proxy Issues regarding network proxies
Projects
None yet
Development

No branches or pull requests

3 participants