coder / vscode-coder

Open any Coder workspace in VS Code with a single click.
MIT License
49 stars 12 forks source link

Proxy problem #300

Open rhysjtevans opened 2 weeks ago

rhysjtevans commented 2 weeks ago

I have a proxy between the coder server and the desktops in an enterprise environment.

When I use VSCode's Remote SSH it works when I use coder it doesn't. SSH works from the command line.

This points me to coder extension not respecting the proxy settings.

Anyone have any tips to troubleshoot further?

code-asher commented 2 weeks ago

Our extension delegates to the Remote SSH extension for the actual connection part, so my guess is that the failure is in one of the API calls we make before making the connection.

Could you post the error you get to confirm?

If that is the case, I think we probably need to explicitly read the http_proxy environment variable and its friends, and http.proxy from VS Code settings as well, and then set that on our Axios client (perhaps in the request interceptor).

Edit: I think VS Code uses a weird order of preference for those vars, should confirm and make sure we use the same.

rhysjtevans commented 2 weeks ago

Thanks for the quick response @code-asher. I couldn't really see an error which is part of the problem.

  1. Not sure where to look if I'm honest so some help here would be greatly appreciated. I'll see what I can find next week now I'm afraid.
  2. The error I do see is simply a 503 from the default gateway which won't work

From what I have seen and experienced if it doesn't currently do that then that makes complete sense and for it to respect the vscode settings would be ideal 👍

code-asher commented 2 weeks ago

An error like 503 is what I was looking for, thank you! Should be easy enough to fix this, I think.

rhysjtevans commented 2 weeks ago

if you want a tester, let me know

code-asher commented 2 weeks ago

Thank you! Would you be able to download and test https://github.com/coder/vscode-coder/releases/tag/v1.1.0?

rhysjtevans commented 2 weeks ago

The change looks very promising - appreciate the quick turnaround @code-asher - Unfortunately I can't test sooner than this Thursday

code-asher commented 2 weeks ago

Sounds good to me, no rush! :grin:

code-asher commented 1 week ago

So, just FYI, I neglected to test the existing version of the plugin and I might not have actually fixed anything. 1.1.0 now explicitly reads and sets the proxy settings, but when I tested the 1.0.2 just now it actually already used the proxy? Not sure how, unless VS Code is doing some monkey patch magic with the agent. I tested both the http.proxy setting and the http_proxy environment variable, and both made the plugin use the proxy.

Which makes me think the issue might be something else.

Edit: maybe related to no_proxy?

rhysjtevans commented 2 days ago

Sorry for the delay @code-asher , I've tried the build and it definitely helped. I've got an SSH-based problem now. Once I've got that working I'll revert the VSCode extension to rule that out and let you know.

Cheers,

code-asher commented 1 day ago

Awesome! I also discovered that whether our proxy is used depends on the value for http.proxySupport; if this is set to on or off then it will use the support in the plugin, but any other value will use the VS Code built-in.

rhysjtevans commented 2 hours ago

@code-asher I've managed to work out how to enable trace logs on vscode, I noticed in the logs there was this output. (I've substituted values) Also additional note worthy context, I've got the coder cli working through the proxy and I can ssh to the coder workspaces.

ProxyResolver#resolveProxy settings http://192.168.0.254:3128/https://coder.localdomain/api/v2/users/me PROXY 192.168.0.254:3128

I presume there's a concatenation/instantiation problem with the proxy?