1.wsl下socks5快速配置git http 代理2024-12-31 收起 编辑配置文件 vim ~./bashrc 将00000替换为你的端口 export windows_host=`cat /etc/resolv.conf|grep nameserver|awk '{print $2}'` export ALL_PROXY=socks5://$windows_host:00000 export HTTP_PROXY=$ALL_PROXY export http_proxy=$ALL_PROXY ...
WSL2 默认使用 NAT 网络,因此 DNS 服务器执行 Windows,在/etc/resolv.conf中可以找到 DNS 服务器。 之后打开 Windows Calsh 的局域网连接,并找到端口。 server=`awk '$1 == "nameserver" {print $2}' /etc/resolv.conf` port=7897 export http_proxy="http://$server:$port" export https_proxy="http...
export http_proxy="http://${hostip}:${http_hostport}" export ALL_PROXY="socks5://${hostip}:${socks_hostport}" export all_proxy="socks5://${hostip}:${socks_hostport}" ' alias unproxy=' unset ALL_PROXY unset https_proxy unset http_proxy unset all_proxy ' alias echoproxy=' ec...
alias unsetproxy='unset https_proxy; \ unset http_proxy; \ unset all_proxy; \ unset ALL_PROXY;' 注意https_proxy处应为http://${hostip}:7890,否则会导致curl时OpenSSL SSL_connect: SSL_ERROR_SYSCALL的问题。然后,在终端运行命令setproxy就可以为当前终端设置网络了。 相关配置: 此时可以用wget测试。...
1. 在Clash for Windows中开启TUN Mode,这是设置WSL代理的关键步骤。2. 确保你的WSL环境已经安装,并且当前正在运行。3. 为了允许局域网连接代理,需要设置本地ipv4地址。例如,使用"192.168.22.80"作为本机ipv4地址进行代理配置。在WSL中执行以下命令,以实现代理设置:执行命令:`export http_proxy=...
# 设置 socks5 代理sethttp_proxy=socks5://dlgcy:w1xxx@d.dlgcy.com:10888# 验证 curl-Iwww.google.com 返回200 证明成功: 然后即可执行命令: 不过报了不支持代理错误,重开 cmd 进行清除 cmd 代理后,还是报代理不支持,说明是我之前在 WSL 中设置的不对: ...
现在,http_proxy和https_proxy环境变量已经设置好了。你可以使用以下命令来验证环境变量是否设置正确: echo $http_proxyecho $https_proxy 然后在你的对应WSL容器中curl特定的网站,看实际访问是否成功,如: 可见我这里是成功的。 另外,这种方法是在当前用户的 shell 配置文件中设置环境变量,因此只对当前用户生效。如果...
git config --global http.proxy "${PROXY_HTTP}" git config --global https.proxy "${PROXY_HTTP}" } unset_proxy(){ unset http_proxy unset HTTP_PROXY unset https_proxy unset HTTPS_PROXY git config --global --unset http.proxy git config --global --unset https.proxy ...
56.3是我的宿主机,然后任意虚拟机或是wsl按照图中设置了这个http_proxy,就能自由航行了 ly火星人ly ---r-- 4 是这样吗? 曼达洛大师-博卡坦 ---x-wx 11 关键的都用红框圈出来了 asdjkl1245789 ---x 1 export http_proxy=代理地址和端口 这个指令吧,这个指令用好多次了 登录百度账号 ...
autoProxy*booleantrue強制 WSL 使用 Windows 的 HTTP Proxy 資訊 defaultVhdSizesize1099511627776(1TB)設定儲存 Linux 發行版 (例如 Ubuntu) 檔案系統的虛擬硬碟 (VHD) 大小。 可用來限制允許散發檔系統佔用的大小上限。 具有path值的項目必須是具有逸出反斜線的 Windows 路徑,例如:C:\\Temp\\myCustomKernel ...