How to proxy on wsl2: Difference between revisions
Line 17: | Line 17: | ||
# .bashrc 里设开关 | # .bashrc 里设开关 | ||
host_ip=$(awk '/nameserver/ {print $2}' /etc/resolv.conf 2>/dev/null) | host_ip=$(awk '/nameserver/ {print $2}' /etc/resolv.conf 2>/dev/null) | ||
alias pon='export {http,https,ftp,all}_proxy="http://$host_ip: | alias pon='export {http,https,ftp,all}_proxy="http://$host_ip:12345"' | ||
alias poff='unset {http,https,ftp,all}_proxy' | alias poff='unset {http,https,ftp,all}_proxy' | ||
</syntaxhighlight> | </syntaxhighlight> |