arlyxiao / best-practice

1 stars 0 forks source link

WSL2 proxy script #90

Open arlyxiao opened 2 years ago

arlyxiao commented 2 years ago

Static ip

export https_proxy="http://192.168.112.1:7890"
export http_proxy="http://192.168.112.1:7890"
export all_proxy="sock5://192.168.112.1:7890"
export ALL_PROXY="sock5://192.168.112.1:7890"

dynamic

export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*')
export https_proxy="http://${hostip}:7890"
export http_proxy="http://${hostip}:7890"