𝖄𝕺🌎𝕿𝕽𝕺¥

𝖄𝕺🌎𝕿𝕽𝕺¥

𝕴 𝖉𝖔 𝖒𝖆𝖌𝖎𝖈
github

How to deal with slow access to GitHub in WSL?

Solution#

Different proxy software may have different operations, but not explained in detail here... Here is an example using Clash.

As shown in the figure, the proxy service port number is "7890", remember to enable ALLOW LAN.
clash1

Open the bash file of WSL, using the .bashrc file as an example:
Add the following

# proxy list
# Note that if not exported, other bash scripts cannot access this variable. In order to access it in .ssh/config, you must export it
# https://unix.stackexchange.com/a/495163
export host_ip=$(cat /etc/resolv.conf |grep "nameserver" |cut -f 2 -d " ")
# wget is special, it does not recognize all_proxy, only http_proxy and https_proxy
alias proxy="export all_proxy=http://$host_ip:7890 http_proxy=http://$host_ip:7890 https_proxy=http://$host_ip:7890"
alias unproxy='unset all_proxy http_proxy https_proxy'
proxy

Now let's check the proxy software again, as shown in the figure, the WSL proxy is successful!
clash2

Source#

wsl 如何正确代理.md - GitHub

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.