Introduction & Problem Categories
As a powerful proxy tool, ClashX may encounter various issues during daily use. These issues can be broadly categorized as follows:
This guide will explain diagnostic methods and solutions for each type of issue, helping you quickly restore normal operation.
Before troubleshooting, it is recommended to check: Is ClashX running, is the network connection normal, and are the application proxy settings correct. These three points solve most problems.
Connection Issues Troubleshooting
Connection issues are the most common ClashX failures. This section explains how to diagnose and resolve these problems.
Issue 1: Cannot Connect / Proxy Not Working
Symptoms
- Applications cannot access the internet
- Connection timeout errors
- ClashX is running but has no effect
Troubleshooting Steps
Step 1: Check ClashX Running Status
# Check in terminal for ClashX process
ps aux | grep clash
# Output example:
# xxx /Applications/ClashX.app/Contents/MacOS/ClashX
Step 2: Verify System Proxy Settings
Open System Settings â Network â Wi-Fi/Ethernet â Details â Proxies
Ensure the following settings are correct:
- Web Proxy (HTTP): 127.0.0.1:7890
- Secure Web Proxy (HTTPS): 127.0.0.1:7890
- SOCKS Proxy: 127.0.0.1:7891
Step 3: Test Network Connection
# Check if ClashX is listening on the expected port
lsof -i :7890
lsof -i :7891
# Test proxy connection
curl -x http://127.0.0.1:7890 http://www.gstatic.com/generate_204
âĸ Firewall blocking ClashX
âĸ Proxy port occupied by other applications
âĸ No available nodes in subscription
âĸ macOS version incompatibility
Issue 2: Connection Timeout
Symptoms
- Connection normal but response slow
- Large file downloads failing
- Some websites cannot load
Solution
Increase Connection Timeout
# Edit config.yaml, add in General settings:
protocol: TLS1.2
# TCP connection timeout (s)
connect-timeout: 5
# read timeout (s)
read-timeout: 5
# If it still times out, try increasing to:
connect-timeout: 10
read-timeout: 10
Timeout adjustments should be gradual, starting from default values, increasing by 1-2 seconds each time until the problem is resolved. Excessively high timeouts will affect overall performance.
Issue 3: Intermittent Connection Drops
Symptoms
- Connection randomly drops during use
- Need to restart ClashX to recover
- Particularly unstable during certain times
Solution
- Update Nodes: Manually update subscription link, remove unstable nodes
- Switch Protocol: Try different proxy protocols (SS, Trojan, VMess)
- Check Router: Restart network devices, check connection stability
- Enable Keep-Alive: Enable TCP Keep-Alive in configuration
Enable Keep-Alive Configuration
proxies:
- name: "Stable node"
type: ss
server: example.com
port: 443
cipher: aes-256-gcm
password: "password"
udp: true
# Enable Keep-Alive
keep-alive: true
TUN Mode Issues
TUN mode is a system-level proxy that does not require separate configuration for each application. However, it can also cause issues.
Issue 1: TUN Mode Cannot Be Enabled
Common Errors
| Error Code | Cause | Solution |
|---|---|---|
| Permission Denied | Insufficient permissions | Use administrator account or grant permissions |
| Device Not Found | TUN device initialization failed | Restart ClashX or system |
| Port Already in Use | Port already in use | Change port or close occupying application |
| Stack Error | Protocol stack conflict | Try switching to gvisor or system |
Troubleshooting Steps
Check User Permissions
# Check if current user is admin
id
# Check ClashX permissions
ls -la /Applications/ClashX.app/Contents/MacOS/ClashX
Solutions
- Ensure using administrator account
- Grant TUN permissions in ClashX settings
- Try using gvisor protocol stack (more stable)
- Check for conflicts with other VPN software
Issue 2: No Network After Enabling TUN Mode
Symptoms
- Completely no network after enabling TUN mode
- Local IP address displays abnormally
- DNS resolution failed
Quick Recovery
Disable TUN Mode in Terminal
# Force disable TUN
defaults write com.west2online.ClashX tun-enabled -bool false
# Restart ClashX
killall ClashX
Configuration Fix
Correct TUN Configuration Example
tun:
enable: true
stack: gvisor # Recommended gvisor
dns-hijack:
- any:53 # Hijack all DNS queries
auto-route: true # Auto configure routing
auto-detect-interface: true
# DNS Configuration
dns:
enable: true
listen: 127.0.0.1:53
enhanced-mode: fake-ip
nameserver:
- 119.29.29.29
- 223.5.5.5
Issue 3: TUN Mode Affecting Other Applications
Symptoms
- Some apps (like iMessage, Apple Music) cannot function normally
- Local services (like MySQL, Redis) connection failed
- VoIP apps have no audio
Solution
Create Bypass Rules
# Configure in config.yaml
tun:
enable: true
stack: gvisor
dns-hijack:
- any:53
auto-route: true
auto-detect-interface: true
# Traffic filtering - Apps excluded from TUN
include-apps:
- com.apple.dt.Xcode
- com.docker.docker
# Network interfaces excluded from TUN
exclude-interfaces:
- en1
- en2
Subscription Link Issues
Subscription links are an important way to configure ClashX. Common subscription issues include import failures and nodes not displaying.
Issue 1: Subscription Import Failed
Symptoms
- No response after pasting link
- Displays "Invalid URL"
- Configuration file empty after import
Troubleshooting Steps
Verify Subscription Link Format
# Check if link is valid
curl -I "https://example.com/subscribe"
# Validate response content-type
curl -I -H "Accept-Encoding: gzip" "https://example.com/subscribe"
Common Causes & Solutions
| Issue | Check Method | Solution |
|---|---|---|
| Link expired | Check provider notifications | Update to new link |
| URL contains special characters | Check for spaces or symbols | URL encode or use quotes |
| Network cannot access | Open link in browser | Check network or use proxy |
| Format incompatible | View returned content | Convert to YAML format |
Issue 2: Subscription Update Failed
Symptoms
- No response when clicking update button
- Displays "Update failed"
- Nodes remain old list
Solution
Manual Resubscribe
- Delete existing subscription
- Clear configuration file
- Re-import subscription link
- Wait for download to complete
Set auto-update interval in ClashX settings. Usually recommended to update every 6 hours, avoid frequent updates.
Issue 3: Nodes Not Displayed in Subscription
Symptoms
- Subscription imported but no available nodes
- proxy-groups is empty
- Rules cannot match
Check Process
Check Configuration File Content
# Open the config file
open ~/.config/clash/config.yaml
# Check the following:
# 1. proxies section has nodes
# 2. proxy-groups are correct
# 3. rules are complete
Common Reasons
- Subscription link format incompatible with ClashX
- Node information incomplete or format error
- Proxy protocol version not supported
- YAML syntax error
Ensure the format provided by the subscription provider is ClashX compatible. Some providers may require specific User-Agent or port numbers.
Performance Optimization
ClashX performance issues usually manifest as slow speed, high memory usage, and high CPU usage.
Issue 1: Slow Proxy Speed
Symptoms
- Slow web page loading
- Video buffering
- File download speed lower than normal
Troubleshooting Steps
Test Node Latency
# Run speed test in ClashX Dashboard
# Or test with CLI
curl -x socks5://127.0.0.1:7891 http://www.gstatic.com/generate_204 -w "%{time_total}\n" -o /dev/null
# Check latency to different regions
ping -c 4 8.8.8.8 # requires proxy settings
Optimization Solutions
- Select Optimal Node: Use url-test to automatically select lowest latency node
- Adjust DNS: Use low-latency DNS servers
- Enable Multiplexing: Enable HTTP/2 on supported protocols
- Check Local Network: Ensure Wi-Fi signal is stable
Performance Optimization Configuration Example
# Use url-test Auto Select fast nodes
proxy-groups:
- name: "âģī¸ Auto Select"
type: url-test
proxies:
- "nodes1"
- "nodes2"
- "nodes3"
url: "http://www.gstatic.com/generate_204"
interval: 300 # test every 5 minutes
tolerance: 50 # 50ms tolerance
# optimize DNS Configuration
dns:
enable: true
enhanced-mode: redir-host # better performance than fake-ip
nameserver:
- 119.29.29.29 # Fast CN DNS
- 223.5.5.5
fallback:
- https://1.1.1.1/dns-query # Fast Global DNS
Issue 2: High Memory Usage
Symptoms
- ClashX using more than 500MB memory
- System becomes sluggish
- Other applications respond slowly
Solution
- Reduce Node Count: Delete unused nodes and rule sets
- Disable Unnecessary Features: Turn off Dashboard, TUN mode
- Optimize Rules: Use rule sets instead of individual rules
- Regular Restart: Restart ClashX daily to free memory
Monitor Memory Usage
# View ClashX real-time memory usage
top -p $(pgrep ClashX)
# Export memory usage details
ps aux | grep ClashX
Issue 3: High CPU Usage
Symptoms
- ClashX process CPU usage over 50%
- Fan spinning fast
- Battery draining quickly (laptop)
Solution
- Check Rule Complexity: Too many rules increase CPU burden
- Disable Fake-IP: Use redir-host mode
- Limit url-test Frequency: Increase test interval
- Update to Latest Version: New versions usually have performance optimizations
Reduce CPU Usage Configuration
dns:
enable: true
enhanced-mode: redir-host # instead of fake-ip
# Reduce log level
log-level: warning
# Reduce test frequency
proxy-groups:
- name: "âģī¸ Auto Select"
type: url-test
interval: 600 # increase to 10 minutes
Configuration File Issues
Configuration file errors are a common cause of ClashX not working properly.
Issue 1: YAML Syntax Errors
Symptoms
- Displays "Parse error" or "Invalid config"
- Configuration file cannot load
- Some configuration items not taking effect
Common Errors & Fixes
| Error Type | Example | Correct Way |
|---|---|---|
| Indentation error | Using Tab indentation | Use 2 spaces |
| No space after colon | name:test | name: test |
| Special characters not escaped | password: pass@123 | password: "pass@123" |
| List format error | proxies: node1, node2 | proxies: - node1 - node2 |
Validate Configuration File
Use Online YAML Validator
Visit yamllint.com or jsoncrack.com to validate configuration file
Or use command line tool:
# Validate YAML with Python
python3 -c "import yaml; yaml.safe_load(open('config.yaml'))"
# No output means config is valid
Issue 2: Configuration Items Not Taking Effect
Symptoms
- Rules still not applied after modification
- New proxy nodes not displayed
- DNS settings invalid
Solution
1. Edit configuration file
2. Click "Reload Configuration" in ClashX UI
3. Or restart ClashX application
4. Wait 2-3 seconds for it to take effect
- Ensure configuration file is saved
- Use "Reload Configuration" instead of "Enable"
- Check file permissions are correct
- View ClashX logs for more information
Issue 3: Configuration File Lost or Corrupted
Symptoms
- Cannot find configuration file
- Configuration file cannot open
- Error when starting ClashX
Recovery Steps
Configuration File Location
# macOS default location
~/.config/clash/config.yaml
# Open the config file directory
open ~/.config/clash/
Recovery Actions
- Close ClashX
- Backup existing configuration file (if any)
- Restore from backup or re-import subscription
- Restart ClashX
Other Common Issues
Issue 1: DNS Resolution Failed
Symptoms
- Cannot access some websites
- Displays "DNS failed" or "Cannot resolve host"
- DNS query timeout
Solution
Test DNS
# Test DNS resolution
nslookup google.com
# Diagnose with dig
dig google.com @119.29.29.29
# test DoH (DNS over HTTPS)
curl -H 'Accept: application/dns-json' 'https://dns.google/resolve?name=google.com'
Configuration Optimization
Recommended DNS Configuration
dns:
enable: true
listen: 127.0.0.1:53
enhanced-mode: redir-host
nameserver:
- 119.29.29.29 # Tencent DNS
- 223.5.5.5 # AliDNS
- 8.8.8.8 # Google DNS
fallback:
- https://1.1.1.1/dns-query # Cloudflare DoH
- https://dns.google/dns-query # Google DoH
fallback-filter:
geoip: true
geoip-code: CN
ipcidr:
- 240.0.0.0/4
Issue 2: SSL/TLS Certificate Errors
Symptoms
- Displays "Certificate verification failed"
- Some HTTPS websites cannot access
- Browser shows certificate untrusted warning
Temporary Solution (Not Recommended)
Skipping certificate verification reduces security. Use only in test environments.
Configure Skip Certificate Verification (Debug Only)
proxies:
- name: "Test node"
type: trojan
server: example.com
port: 443
password: "password"
skip-cert-verify: true # not recommendedlong-termUse
Issue 3: Application Cannot Connect to Proxy
Symptoms
- A specific app cannot use proxy
- App shows offline status
- Other apps work but this one does not
Solution
- Check App Proxy Settings: App itself may need proxy configuration
- Allow Local Connections: Enable "Allow LAN" in ClashX
- Close App Firewall: Some security software may block connections
- Restart App: Clear cached network connections
Prevention Measures & Best Practices
Many issues can be prevented by following best practices.
Regular Maintenance
- Weekly Node Updates: Keep latest node list
- Monthly Log Checks: Discover potential issues early
- Regular Backups: Prevent configuration file loss
- Update ClashX: Get latest features and fixes
Configuration Best Practices
- Keep Configuration Simple: Only configure necessary rules and nodes
- Use Version Control: Manage configuration files with Git
- Document Changes: Record the purpose of each configuration item
- Test New Configurations: Test thoroughly before applying globally
Backup Strategy
Backup Configuration Files
# Create config backup
cp ~/.config/clash/config.yaml ~/.config/clash/config.backup.yaml
# Backup with Time Machine (macOS)
defaults write com.west2online.ClashX autosyncconfig -bool true
# Check backups regularly
ls -la ~/.config/clash/
Monitoring & Logging
- Enable detailed log level:
log-level: debug - Regularly check log file:
~/.config/clash/clashx.log - Monitor system resource usage
- Use Dashboard for real-time monitoring
Recommended monthly checks:
- [ ] Update subscription links
- [ ] Check disk space
- [ ] Verify DNS configuration
- [ ] Backup configuration files
- [ ] Check system updates
- [ ] Test network connection
- [ ] Clean log files