v2rayN参数

设置 >

  • 允许来自局域网的连接 ☑️
  • 开启Mux多路复用 ☑️

基础设置

等会删除

socks端口

v2rayN左下角有显示,太旧的版本或许没有。

局域网:[socks:10808]

局域网socks端口

获取IP

WSL2访问Windows不能直接与本机Localhost共享端口代理。

在WSL2下

1
cat /etc/resolv.conf

得到如下反馈

1
2
3
4
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.31.48.1

vim ~/.bashrc

1
2
3
4
5
6
7
8
9
10
export windows_host=`cat /etc/resolv.conf|grep nameserver|awk '{print $2}'`
export ALL_PROXY=socks5://$windows_host:10808
export HTTP_PROXY=$ALL_PROXY
export http_proxy=$ALL_PROXY
export HTTPS_PROXY=$ALL_PROXY
export https_proxy=$ALL_PROXY

if [ "`git config --global --get proxy.https`" != "socks5://$windows_host:10808" ]; then
git config --global proxy.https socks5://$windows_host:10808
fi

验证

curl www.google.com

关闭wsl

wsl –shutdown