9

Proxy for VS Code

 2 years ago
source link: https://discretetom.github.io/posts/vscode-http-proxy/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Setup HTTP Proxy for VS Code and Its Built-in Terminal

Including how to configure the authentication.

Proxy for VS Code

In settings.json, add the following content:

{
  "http.proxy": "<protocol>://<your-proxy-server>:<port>"
}

Tips:

  • The protocol field is required, it has to be one of http, https.
  • The port field is required.
  • The default value of http.proxy will inherit from the environment variable http_proxy and https_proxy.
  • There is only one http.proxy, no https.proxy.
  • This setting will apply to VS Code itself and its plugins. For example, I’m using Go plugin, when I run Go: Install/Update Tools command, this proxy will take effect.
  • This setting will not apply to the built-in terminal of VS Code.

Proxy for the Built-In Terminal

In settings.json, add the following content:

{
  "terminal.integrated.env.<platform>": {
    "http_proxy": "<protocol>://<your-proxy-server>:<port>",
    "https_proxy": "<protocol>://<your-proxy-server>:<port>"
  }
}

Tips:

  • The platform should be one of windows, linux or osx.
  • The http_proxy and https_proxy will take effect individually. You’d better set both of them.

Authentication

Use this format of URL:

<protocol>://<username>:<password>@<your-proxy-server>:<port>


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK