tyr0ne

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

  •  1
     
  •   tyr0ne · Jun 24, 2024 · 3750 views
    This topic created in 753 days ago, the information mentioned may be changed or developed.
    远程机器用不了 github copilot ,有没有办法让远程机器 proxy 到本地,本地机器有 clash 、没有公网 ip
    3 replies    2024-06-25 16:38:04 +08:00
    stonesirsir
        1
    stonesirsir  
       Jun 24, 2024 via Android
    ssh 隧道,remote 模式
    edk24
        2
    edk24  
       Jun 25, 2024   ❤️ 5
    在你的 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
        3
    tyr0ne  
    OP
       Jun 25, 2024 via iPhone
    @edk24 牛,看着靠谱,回去试试
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2732 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 01:07 · PVG 09:07 · LAX 18:07 · JFK 21:07
    ♥ Do have faith in what you're doing.