使用正在使用的VS代码的SSH连接的透明代理

发布于 2025-01-20 15:05:55 字数 1198 浏览 4 评论 0原文

如标题所说,我正在寻找一种通过HTTP/Socks5代理使用SSH的方法。代理服务提供商软件是ClashforWindows

某些符号

  • c是运行与代码的Windows 11主设备,并启用了远程SSH扩展名。
  • s1s2是远程服务器,它位于Intranet网络下的实验室中。 S1是Arduino上的Web服务器。 S2是安装了Windows 10服务器的服务器。尽管实验室有自己的公共IPv4地址,但它被管理员阻止,这意味着我无法通过公共地址达到它。
  • P是代理服务器。

cclashforwindows上的当前情况

已安装,并在127.0.0.1:7890启用了代理。 HTTP和Socks5都可以使用,因为我在使用Switchyomega附加组件上使用它们在Edge浏览器上。

为了举一个当前情况的示例,假设s1具有IP 10.0.0.7和s2具有IP 10.0.0.8。

目前,我可以使用c上的浏览器来通过代理服务器访问s1部署的网站。也就是说,c< - > p< - > S1正常工作。

但是,即使我已经在VS Code设置中设置了代理,我也无法使用c上的VS代码来建立SSH连接。我还尝试在clashforwindows的设置中启用系统代理。 VS代码中代理设置的详细信息可以在下面的图中看到。

解决

  1. 如何实现c< - > p< - > S2
  2. SSH连接是否有使用HTTP/Socks5代理的障碍?

As the title said, I'm looking for a method to use SSH via a http/socks5 proxy. The proxy service provider software is ClashForWindows.

Some notations

  • C is a Windows 11 Home device running VS Code, with remote-SSH extension installed and enabled.
  • S1, S2 are the remote servers, which is located in a lab under an intranet network. S1 is a web server on Arduino. S2 is a server with Windows 10 Server installed. Though the lab has its own public IPv4 address, it is blocked by the admin, which means I could not reach it by means of the public address.
  • P is the proxy server.

Current situation

On C, ClashForWindows is installed and the proxy is enabled on 127.0.0.1:7890. Both http and socks5 are available since I'm using them on Edge browser with SwitchyOmega add-on.

To give an example of current situation, let's say S1 has an IP 10.0.0.7 and S2 has an IP 10.0.0.8.

Currently, I could use the browser on C to visit the website deployed on S1 through the proxy server. That is to say, C <--> P <--> S1 is working properly.

However, I cannot use the VS Code on C to establish SSH connection with S2, even though I have set proxy in VS Code settings. I've also tried to enable system proxy in settings of ClashForWindows. Details of proxy settings in VS Code can be seen in the picture below.

Proxy settings in VS Code

Problems to solve

  1. How to achieve something like C <--> P <--> S2 ?
  2. Are there any barriers for SSH connections to use a http/socks5 proxy ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

和我恋爱吧 2025-01-27 15:05:55

使用下面的命令启动VSCODE
代码-proxy-server =“ xxx.xx.xx.xx:port”

add命令in desktop for vscode

/usr/ share/applications/code.desktop

exec =/usr/usr/share/share/code/code/code/code -proxy-server = “ xx.xxxx:xxx” - nity-launch%f

start vscode with below command
code --proxy-server="xxx.xx.xx.xx:port"

add command in desktop for vscode

/usr/share/applications/code.desktop

Exec=/usr/share/code/code --proxy-server="xx.x.x.xx:xxx" --unity-launch %F

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文