microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.62k stars 279 forks source link

VSCode Remote Tunnels Extension not using proxy settings #8209

Open krzychomm opened 1 year ago

krzychomm commented 1 year ago

Our customer would like to use extension remote-tunnels to access VMs in the Azure tenant (Neutral Tenant). However, the extension seems to ignore the proxy settings.

The setup is as follows: VM with VSCode 1.76.00 as server on the Neutral Tenant Client with 1.77.0-insider (also tested with 1.76) in our Corporate Network

The customer tested this together with our corporate IT and found out, that setting the proxy in VSCode to use zscaler at 127.0.0.1:9000 is working with in general, but the remote-tunnels extension is trying to connect directly, ignoring the proxy setting, and is therefore blocked.

Browser access to the remote target works fine! The brower uses a pac file. By using the network analysis function of the browser, we can see that global.rel.tunnels.api.visualstudio.com is connected via 127.0.0.1:9000.

I therefore think it is a bug, that vscode remote-tunnels does not use the proxy settings and would like to address this.


Additional info for the proxy setting on client side. Tried changing the Proxy Strict SSL option, Tried changing the proxy support to all available options.

image

However, I can see the machine state correctly

image

After trying to connect, the connection attempt is aborted after approx 10s with the following error message

image

Note: This has also been tested with Linux VMs and several other Windows Machines - however, the server side isn't the problem here. I should add, that a remote connection using the remote-tunnels extension from machines that are not in our corporate network works fine as well.

connor4312 commented 1 year ago

I implemented this in the tunnel extension for most requests, but it seems we cannot read the http.proxy at the point in the lifecycle when a tunnel opens (https://github.com/microsoft/vscode/issues/177502) and Dev Tunnels also does not support providing an Agent in the websocket tunnel connection (issue opened internally).