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.67k stars 289 forks source link

[error]run vscode-server via local ssh socks5 proxy #8035

Open hermanzhaozzzz opened 1 year ago

hermanzhaozzzz commented 1 year ago

Hi, I have the need to run a no-internet server as my vscode-server (that is in the slurm system). I used ssh proxy for using https.

export https_proxy="socks5://127.0.0.1:7070"; 
export HTTPS_PROXY="socks5://127.0.0.1:7070"; 
export all_proxy="socks5://127.0.0.1:7070"; 

But I found this error

(base) ➜  bin vscode-server          
[2023-02-13 17:03:49] error failed to lookup tunnel: connection error: error sending request for url (https://asse.rel.tunnels.api.visualstudio.com/api/v1/tunnels/p25x84vd?includePorts=true&tokenScopes=host): error trying to connect: tcp connect error: Network unreachable (os error 101)

I can use this vscode-server cmd in a server which can access the internet.

(base) ➜  ~ vscode-server

Open this link in your browser https://insiders.vscode.dev/+ms-vscode.remote-server/......

Some useful informations

(base) ➜  bin proxy.on
(base) ➜  bin curl www.baidu.com
<html><script>window.location.href="https://its.pku.edu.cn/?cause=unauthN&gowhere="+encodeURIComponent(window.location.href)</script></html>%                                                                                   
(base) ➜  bin proxy.off
(base) ➜  bin curl www.baidu.com
curl: (7) Couldn't connect to server

(base) ➜  bin which proxy.on
proxy.on: aliased to export https_proxy="socks5://127.0.0.1:7070"; export HTTPS_PROXY="socks5://127.0.0.1:7070"; export all_proxy="socks5://127.0.0.1:7070"; git config --global http.proxy "socks5://127.0.0.1:7070"; git config --global https.proxy "socks5://127.0.0.1:7070"

(base) ➜  bin which proxy.off
proxy.off: aliased to export https_proxy=""; export HTTPS_PROXY=""; export all_proxy="";git config --global --unset http.proxy; git config --global --unset https.proxy
eleanorjboyd commented 1 year ago

@connor4312, assigning this to you since it seems in your domain but lmk if that is incorrect and I'll investigate from there. Thanks

connor4312 commented 1 year ago

Fyi code-server has been replaced by Remote Tunnels which is accessible on the 'standalone CLI' via code tunnel. I did some work, to support HTTP(S) proxies via that environment variable in this month's release. However, it does not support SOCKS proxies yet. I will keep this feature open as a request to support that.

hermanzhaozzzz commented 1 year ago

Thanks for your work. I think it will be a good feature for cluster server users!

—————————————————————— ZHAO Hua-nan

Ph. D. candidate School of Life Sciences, Tsinghua University

在 2023年2月14日 +0800 18:50,Connor Peet @.***>,写道:

Fyi code-server has been replaced by Remote Tunnels which is accessible on the 'standalone CLI' via code tunnel. I did some work, to support HTTP(S) proxies via that environment variable in this month's release. However, it does not support SOCKS proxies yet. I will keep this feature open as a request to support that. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

carstenbauer commented 3 months ago

@connor4312 Any updates on supporting SOCKS proxies? I'd need this feature as well.