WSL2使用V2rayN本地网络代理服务器
v2rayN参数
设置 >
- 允许来自局域网的连接 ☑️
- 开启Mux多路复用 ☑️
socks端口
v2rayN左下角有显示,太旧的版本或许没有。
局域网:[socks:10808]
获取IP
WSL2访问Windows不能直接与本机Localhost共享端口代理。
在WSL2下
1 | cat /etc/resolv.conf |
得到如下反馈
1 | # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf: |
vim ~/.bashrc
1 | export windows_host=`cat /etc/resolv.conf|grep nameserver|awk '{print $2}'` |
验证
curl www.google.com
关闭wsl
wsl –shutdown
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 笨蛋小方!