Clash For Linux

Introduce the usage of Clash For Linux.
  1. Download the latest version from https://github.com/Dreamacro/clash/releases.
  2. Unzip the download file and run sudo chmod +x clash-exe to give it execute permission.
  3. Run ./clash-exe -f config.yaml -d config-directory and you should see the following log.
    • config.yaml is supported by you VPN provider or designed by you.
    • config-directory is the directory where the configuration files Country.mmdb(1) and cache.db are stored.


  4. Open Network and configure the HTTP Proxy and Socks Host to match the configuration in config.yaml.

    For example:

    • The configuration of HTTP and Socks in config.yaml is as follows:

      # port of HTTP
      port: 7890
      
      # port of SOCKS5
      socks-port: 7891
      
    • So the configuration of HTTP Proxy and Socks Host should be consistent with the configuration in config.yaml.


  5. Open your browser and visit the specified website to check if config.yaml takes effect. If does, you will see a log similar to the one below.


Sometimes it is necessary to access the website from a terminal. The following environmental variables should be set correctly before accessing.

  • all_proxy
  • http_proxy
  • https_proxy
  • ftp_proxy

Demo

export https_proxy=socks://127.0.0.1:7891/
echo $https_proxy
socks://127.0.0.1:7891/
git clone https://github.com/giterlizzi/dokuwiki-template-bootstrap3.git
Cloning into 'dokuwiki-template-bootstrap3'...
remote: Enumerating objects: 11433, done.
remote: Counting objects: 100% (561/561), done.
remote: Compressing objects: 100% (232/232), done.
remote: Total 11433 (delta 333), reused 521 (delta 321), pack-reused 10872
Receiving objects: 100% (11433/11433), 14.42 MiB | 13.27 MiB/s, done.
Resolving deltas: 100% (6669/6669), done.

(1) The MaxMind DB (mmdb) file format is a database format that maps IPv4 and IPv6 addresses to data records using an efficient binary search tree. Country.mmdb is a global IP database that enables the resolution and geolocation of IP information for each country. You can get more details from https://maxmind.github.io/MaxMind-DB/index.html and https://maxmind.github.io/GeoIP2-dotnet/doc/v2.7.0/MaxMind.GeoIP2.Model/Country.html.
Y A C Z S