如何在windows wsl2 Ubuntu中使用v2rayN

问题描述 投票:0回答:1

我在 Windows 中有 v2rayN 应用程序,当我将其设置为全局时,它不会更改我在终端中的 IP,并且我想在 wsl2 Ubuntu 中为我的项目使用它。

我尝试通过连接ubuntu中的端口来使用它

export http_proxy="socks5://127.0.0.1:10808"
export https_proxy="socks5://127.0.0.1:10808"

但是我得到了

Failed to connect to 127.0.0.1 port 10808 after 0 ms: Connection refused

我该怎么做?

ubuntu windows-subsystem-for-linux v2ray
1个回答
0
投票
  1. v2ray -> 设置 -> 选项设置 ->
    Socks port
    应为 10808 并且
    Allow connection from LAN
    应启用

在 WSL2 Ubuntu 终端中,您可以像这样设置代理环境变量:

export http_proxy="socks5://YOUR_WINDOWS_IP:10808"
export https_proxy="socks5://YOUR_WINDOWS_IP:10808"

YOUR_WINDOWS_IP
替换为 Windows 主机的实际 IP 地址。您可以通过 Windows 命令提示符或 PowerShell 中的 running
ipconfig
找到此 IP 地址。然后搜索 IPv4 地址 .

© www.soinside.com 2019 - 2024. All rights reserved.