I am using the "C4 DSL Extension" of VSCode to show previews of my architecture diagrams. The previews are rendered through the WebviewPanel. The source code can be found here: https://gitlab.com/systemticks/c4-grammar/-/blob/master/extension/src/c4-structurizr-preview.ts
It works through a direct connection, but once connected with my corporate network, all requests have to pass through a proxy. VSCode itself handles proxies through the http_proxy and https_proxy variables. However, the WebviewPanel does not seem to take those settings.
The following figure shows an excerpt of the console. You can see, that the request to query the "structurizr-embed.js" failed. enter image description here
Is this behavior intended? I could not find a setting in VSCode to enable WebviewPanel to request via proxy.
Note: I am using the Linux version of VSCode.
1 Answer 1
I found a solution by setting the http.proxy variable in VSCode. We are using authentication for proxies and previously I exported the http_proxy environment variable in the form of http_proxy=http://<username>:<password>@<host>:<port>.
However, VSCode expects this variable without credentials: http_proxy=http://<host>:<port>. Now I don't understand where it talks the credentials from, but it works.
Comments
Explore related questions
See similar questions with these tags.