Skip to content

Instantly share code, notes, and snippets.

@PSJoshi
Created January 18, 2021 10:53
Show Gist options
  • Select an option

  • Save PSJoshi/0831f635f9f5a7b9c602b80fbbf3125a to your computer and use it in GitHub Desktop.

Select an option

Save PSJoshi/0831f635f9f5a7b9c602b80fbbf3125a to your computer and use it in GitHub Desktop.
Setting up visual studio code behind proxy

Tracking network issues while running VS code editor

It's better to start Visual studio code application with a command line using argument "--log-net-log" and record all network level traffic.

# code --log-net-log=netlog.json

Getting help or diagnostic support in VS code

In order to debug any issues in Visual studio code environment,

Help -> Toggle Developer Tools -> Network

Help -> Toggle Developer Tools -> Console
View -> Command Pallette... -> Toggle Shared Process -> Console
View -> Open View… -> Log (Shared)
View -> Open View… -> Log (Window)

Setting up proxy support

Goto File -> Preferences -> Settings Filter the settings options using "proxy" so that only proxy related settings are visible. Under Http:Proxy Authorization tab, you will see the option of "Edit in settings.json". Click to edit the file. If the file is blank, add the following settings to the file and save.

$ cat settings.json
{
    "http.proxySupport": "on",
    "http.proxy": "http://user:passwd@192.168.1.6:3128",
    "http.proxtStrictSSL": "false",
    "http.proxyAuthorization": null
}

Kindly change user,password, proxy server and proxy port as per your requirements.

base64 conversions

To encode in base64

$ echo "user:passwd"| base64
dXNlcjpwYXNzd2QK

To decode in base64

$ echo dXNlcjpwYXNzd2QK | base64 --decode
@denu5

denu5 commented Oct 16, 2023

Copy link
Copy Markdown

boss here you have typo and mistake:

"http.proxtStrictSSL": "false",

"http.proxyStrictSSL": false,

@IftikharZahid

Copy link
Copy Markdown

Thanks , It works

@MostHated

Copy link
Copy Markdown

Is there a way to have whether this is enabled or not be conditional?

Example being, I only need the proxy enabled when connected to a VPN, otherwise I have to keep trying to edit it on and off (if I remember).
I have seen there are some addons that can let you run scripts on startup, etc.

Now that I think about it, I suppose it might be better to just handle this externally when detecting connection change at the system level and then just edit the settings file itself. Unless there is some easier built-in way to handle this, I will have to give the other route a go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment