logoWeChat
logoWhatsApp
logoTelegram
HometoOthertoArticle Details

Clash Proxy Configuration (Step-by-Step Guide)

Clash Proxy Configuration (Step-by-Step Guide)IPDEEP
dateTime2026-01-30 18:14
dateTimeOther
ad1

Clash, as a powerful rule-based proxy tool, is loved by many users for its flexible proxy rules and rich features. This article will provide you with a detailed Clash proxy configuration and YAML file import tutorial, helping you get started quickly and enjoy a stable and efficient network experience.


Preparation

Before starting, please make sure you have:

○ Downloaded and installed the Clash client

Purchased a usable proxy

Importing YAML Configuration File

I. Extract Proxy Information

After purchasing the proxy, you can obtain proxy information from the service provider including: proxy server domain, port, username, and password.

II. Edit YAML File

Example and Explanation of YAML Configuration File


port: 7890
socks-port: 7891
allow-lan: true
mode: rule
log-level: info

proxies:

- name: "Proxy-1"
  type: http
  server: proxy.example.com
  port: 8080
  username: user
  password: pass

proxy-groups:

- name: "Auto"
  type: select
  proxies:

  - Proxy-1
  - DIRECT

rules:

- DOMAIN-SUFFIX,google.com,Auto
- MATCH,DIRECT 

Segmented Explanation:

1. Basic Configuration Part


port: 7890
socks-port: 7891
allow-lan: true
mode: rule
log-level: info
  

port is the HTTP proxy port Clash listens to on your computer or phone. The default is 7890. You can change it to another unused port like 10809 or 8888. If you use browser proxy, you need to set the port accordingly.

socks-port is the SOCKS5 proxy port Clash listens to, default is 7891. Some programs or games require SOCKS5 protocol; set this port if you want to use SOCKS5.

allow-lan determines whether to allow other devices in your LAN to access the Clash proxy on this device. Set to true if you want your home phone, tablet to use this device as proxy; false if it's a public network or you do not want to share.

mode is the proxy mode, including rule (rule mode, recommended), global (all traffic through proxy), direct (all traffic direct), etc. Set to your preference.

log-level controls the log verbosity: info (normal), warning, error, debug, etc. Use debug for troubleshooting, info for daily use.

2. Proxy Nodes (proxies)


proxies:
  - name: "Proxy-1"
    type: http
    server: proxy.example.com
    port: 8080
    username: user
    password: pass
  

name is the name of the proxy node. You can rename it to Chinese or English, like “My Proxy” or “Node A,” to distinguish different proxies.

type is the proxy type, such as http, https, socks5, ss, vmess, etc. Supported types depend on your Clash version and proxy.

server is the proxy server address. Change it to your actual proxy server domain or IP, e.g., proxy.ipdeep.com.

port is the proxy server port, matching the port provided by your proxy service.

username and password are authentication credentials. Fill them if your proxy requires authentication; remove if not needed.

3. Proxy Groups (proxy-groups)


proxy-groups:
  - name: "Auto"
    type: select
    proxies:
      - Proxy-1
      - DIRECT
  

name is the proxy group name. You can rename it to something like “Auto Select” or “Switch Group” as you like.

type is the proxy group type, including select (manual selection), url-test (automatic speed test to select the fastest), fallback (auto-switch on failure), etc.

proxies contains a list of proxy node names. You can add multiple nodes like “Proxy-1,” “Proxy-2,” and add DIRECT for direct connection.

4. Rule Configuration (rules)


rules:
  - DOMAIN-SUFFIX,google.com,Auto
  - MATCH,DIRECT
  

The first rule means when accessing any domain ending with google.com, use the proxy group named Auto. You can replace it with other domains like youtube.com or facebook.com.

The second rule MATCH,DIRECT is the default rule, meaning all requests that do not match the previous rules are direct connections. You can also change it to use proxy, e.g., MATCH,Auto.

If using global proxy mode, you can write:


port: 7890
socks-port: 7891
allow-lan: true
mode: global
log-level: info

proxies:

- name: "Proxy-1"
  type: http
  server: proxy.example.com
  port: 8080
  username: user
  password: pass

proxy-groups:

- name: "GLOBAL"
  type: select
  proxies:

  - Proxy-1
  - DIRECT

rules:

- MATCH,GLOBAL 

III. Import YAML File into Clash

Click “Profiles,” then click “Import” in the upper right corner and select the local YAML file to import.

IV. Enable Proxy and Verify

1. Enable system proxy

Enable proxy on the Clash client main interface

2. Verify if proxy is effective

Visit Online IP Address Check Tool to see if the IP address has changed

Conclusion

In this article, you learned the basic configuration method of using proxies in Clash. You can also flexibly adjust proxy settings according to your needs to achieve efficient and stable network access.

IPDeep provides high-quality proxy IPs including:

· Residential Proxies

· Data Center Proxies

· Mobile Proxies

and various other proxy types, with over 10 million high-quality IP resources covering more than 200 countries and regions worldwide. Whether it's bypassing geographic restrictions, ensuring data collection, or improving access speed and security, IPDeep can provide you with stable and reliable support to make your network operations smoother and more efficient.

This article was originally created or compiled and published by IPDEEP; please indicate the source when reprinting. ( )
ad2