Skip to content

Instantly share code, notes, and snippets.

@levihuayuzhang
Last active June 7, 2023 04:41
Show Gist options
  • Save levihuayuzhang/2716b057c587c93e81b3cf09ad48e107 to your computer and use it in GitHub Desktop.
Save levihuayuzhang/2716b057c587c93e81b3cf09ad48e107 to your computer and use it in GitHub Desktop.
add clash proxy in WSL2
  1. use following alias to proxy one line command in shell e.g. "px wget www.google.com"
alias px="hostip=$(cat /etc/resolv.conf | grep -oP '(?<=nameserver\ ).*') https_proxy=http://${hostip}:7890 http_proxy=http://${hostip}:7890 all_proxy=socks5://${hostip}:7890"
  1. set clash pass the Windows firewall
  2. allow LAN connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment