在WSL中使用本地Clash代理

Using the local Clash proxy in WSL

First check the port of Clash. Here is7890.

In the local PowerShell, enter ipconfig,

Find the vEthernet (WSL (Hyper-V firewall)) at the bottom, and remember the IPv4 address here. Mine is 172.20.0.1 .

Next, in WSL, add the following code to ~/.bashrc:

alias proxy='export all_proxy=http://172.20.0.1:7890' alias unproxy='unset all_proxy'

Save, then execute the following code to activate:

source ~/.bashrc

Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_USEN