๐–„๐•บ๐ŸŒŽ๐•ฟ๐•ฝ๐•บยฅ

๐–„๐•บ๐ŸŒŽ๐•ฟ๐•ฝ๐•บยฅ

๐•ด ๐–‰๐–” ๐–’๐–†๐–Œ๐–Ž๐–ˆ
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.