PTLin
176 天前
windows .wslconfig
------------------------------
[wsl2]
networkingMode=mirrored
wsl .zshrc
-------------------------------
local host_ip="127.0.0.1"
local host_port=7890
local proxychains_config_filename="/tmp/proxychains.conf"
cat <<EOF >$proxychains_config_filename
strict_chain
nproxy_dns
nremote_dns_subnet 224
ntcp_read_time_out 15000
ntcp_connect_time_out 8000
[ProxyList]
socks5 $host_ip $host_port
EOF
alias proch="proxychains -q -f $proxychains_config_filename"
pp() {
proxy_is_set=${proxy_is_set:=0}
if (( proxy_is_set == 0 )) {
export all_proxy="http://$host_ip:$host_port"
proxy_is_set=1
echo "set proxy"
} else {
unset all_proxy
proxy_is_set=0
echo "unset proxy"
}
}
proch xxx 是用代理运行软件,pp 是开启 all_proxy ,再运行 pp 是关闭。