Why Use Surfshark with ClashX?
Surfshark is a well-known commercial VPN service with servers in 100+ countries. ClashX is a powerful proxy client supporting flexible split routing rules. Together they complement each other:
Typical Use Cases for Combined Usage
- Banking/Email โ Surfshark encrypted tunnel (security first)
- Daily browsing โ Other proxy nodes or direct connection (speed first)
- Streaming โ Surfshark specific region nodes (unlock content)
- Domestic websites โ Direct connection (lowest latency)
For more VPN options, see our VPN Recommendations page.
Get Surfshark Configuration Information
Surfshark doesn't directly provide Clash format subscription links, but supports manual configuration. Follow these steps to get WireGuard keys:
- Log in to Surfshark website โ My Account โ VPN โ Manual Setup
- Select WireGuard protocol
- Generate key pair, note down Private Key
- Select server region, get Server Address and Public Key
- Record Endpoint (server IP:port)
WireGuard manual configuration requires an active Surfshark subscription. If you don't have Surfshark yet, you can import subscriptions using other methods first, see ClashX Subscription Import Tutorial.
WireGuard Configuration Method
Add Surfshark's WireGuard nodes in ClashX (using Clash Meta kernel). First download ClashX, then edit the configuration file:
proxies:
- name: "๐ฆ Surfshark-US"
type: wireguard
server: us-dal.prod.surfshark.com
port: 51820
ip: 10.14.0.2
private-key: "YOUR_PRIVATE_KEY_HERE"
public-key: "SURFSHARK_SERVER_PUBLIC_KEY"
udp: true
mtu: 1280
reserved: [0, 0, 0]
- name: "๐ฆ Surfshark-UK"
type: wireguard
server: uk-lon.prod.surfshark.com
port: 51820
ip: 10.14.0.2
private-key: "YOUR_PRIVATE_KEY_HERE"
public-key: "SURFSHARK_SERVER_PUBLIC_KEY"
udp: true
mtu: 1280
- name: "๐ฆ Surfshark-JP"
type: wireguard
server: jp-tok.prod.surfshark.com
port: 51820
ip: 10.14.0.2
private-key: "YOUR_PRIVATE_KEY_HERE"
public-key: "SURFSHARK_SERVER_PUBLIC_KEY"
udp: true
mtu: 1280Replace YOUR_PRIVATE_KEY_HERE with your WireGuard private key, and SURFSHARK_SERVER_PUBLIC_KEY with the server public key provided by Surfshark. Get this information from Surfshark's manual setup page.
Split Routing Strategy Configuration
Core idea: sensitive traffic goes through Surfshark encrypted tunnel, regular traffic goes through other nodes or direct connection.
proxy-groups:
# Surfshark secure line
- name: "๐ Secure Tunnel"
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
proxies:
- ๐ฆ Surfshark-US
- ๐ฆ Surfshark-UK
- ๐ฆ Surfshark-JP
# Daily proxy line
- name: "๐ Daily Proxy"
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
proxies:
- Other Node 1
- Other Node 2
rules:
# Banking and finance โ Surfshark secure tunnel
- DOMAIN-KEYWORD,bank,๐ Secure Tunnel
- DOMAIN-KEYWORD,paypal,๐ Secure Tunnel
- DOMAIN-SUFFIX,chase.com,๐ Secure Tunnel
- DOMAIN-SUFFIX,wellsfargo.com,๐ Secure Tunnel
# Email โ Surfshark secure tunnel
- DOMAIN-SUFFIX,gmail.com,๐ Secure Tunnel
- DOMAIN-SUFFIX,outlook.com,๐ Secure Tunnel
- DOMAIN-SUFFIX,protonmail.com,๐ Secure Tunnel
# Streaming โ Surfshark (unlock content)
- DOMAIN-SUFFIX,netflix.com,๐ Secure Tunnel
- DOMAIN-SUFFIX,hulu.com,๐ Secure Tunnel
- DOMAIN-SUFFIX,disneyplus.com,๐ Secure Tunnel
# Domestic websites โ Direct
- GEOIP,CN,DIRECT
# Other โ Daily proxy
- MATCH,๐ Daily ProxyKill Switch Alternative
Surfshark's native client has Kill Switch feature (cuts network when VPN disconnects). In ClashX you can use TUN mode to achieve similar effect:
- Enable TUN Mode โ All traffic goes through ClashX, cannot bypass
- Use fallback strategy group โ Automatically switch to backup node when Surfshark disconnects
- Set REJECT fallback rule โ Reject connection if all nodes unavailable instead of direct connection
proxy-groups:
- name: "๐ Secure Tunnel"
type: fallback
url: http://www.gstatic.com/generate_204
interval: 60
proxies:
- ๐ฆ Surfshark-US
- ๐ฆ Surfshark-UK
- ๐ฆ Surfshark-JP
- REJECT # Reject connection if all nodes unavailablePerformance Comparison
| Method | Speed | Latency | Security |
|---|---|---|---|
| Surfshark Direct | 95% | 50ms | โญโญโญโญโญ |
| Through ClashX | 88% | 60ms | โญโญโญโญโญ |
| ClashX Split Routing | 92% | 55ms | โญโญโญโญ |
Using Surfshark through ClashX has 5-10% performance loss, but gains flexible split routing capability. Using split routing strategy (only routing through Surfshark when needed) provides the best overall experience.
Frequently Asked Questions
Q: What's the difference between using Surfshark in ClashX vs using Surfshark client directly?
A: The main difference is split routing capability. Surfshark client is global VPN, all traffic goes through VPN. ClashX can split by rules, only routing needed traffic through Surfshark, other traffic direct or through other proxies.
Q: Can I run Surfshark client and ClashX simultaneously?
A: Not recommended. Both modify system network configuration and may conflict. It's better to close Surfshark client and only use Surfshark nodes through ClashX.
Q: What if WireGuard configuration won't connect?
A: Check: 1) Are private and public keys copied correctly (no extra spaces)? 2) Is server address correct? 3) Is port 51820? 4) Is ClashX using Clash Meta kernel (original Clash doesn't support WireGuard)?
Q: How often do I need to change Surfshark keys?
A: Surfshark's WireGuard keys are long-term valid, no frequent changes needed. But if you suspect key compromise, you can regenerate on Surfshark website.
Q: Can I use other VPNs instead of Surfshark?
A: Yes. Any VPN supporting WireGuard or OpenVPN manual configuration can be added to ClashX using similar methods. NordVPN, ExpressVPN, etc. all support this.
Q: Does this configuration support Apple Silicon Mac?
A: Fully supported. ClashX and WireGuard protocol are both optimized for M1/M2/M3/M4 chips with excellent performance.