vscode remote 怎么让远程机器使用本地代理

7 天前
 tyr0ne
远程机器用不了 github copilot ,有没有办法让远程机器 proxy 到本地,本地机器有 clash 、没有公网 ip
701 次点击
所在节点    Visual Studio Code
3 条回复
stonesirsir
7 天前
ssh 隧道,remote 模式
edk24
6 天前
在你的 ssh_config 里面加入

`RemoteForward 1087 127.0.0.1:1087`

举例, 把本地的 1087 端口共享给服务器的 1087 端口.

然后你就可以在服务器上用`export all_proxy=http://127.0.0.1:1087` 实现代理, 为了方便可以包装两个 alias 放到 bashrc 文件里面

```
# 为终端设置代理
alias proxy='export all_proxy=http://127.0.0.1:1087'
alias unproxy='unset all_proxy'
```
tyr0ne
6 天前
@edk24 牛,看着靠谱,回去试试

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1052231

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX