# How to Configure Split Tunneling for Specific Apps with Fanqiang

> Learn how to configure split tunneling for specific apps with Fanqiang. Route only selected apps through the proxy, keeping other traffic direct for improved performance and control.

- Repository: [如何翻墙/fanqiang](https://github.com/bannedbook/fanqiang)
- Tags: how-to-guide
- Published: 2026-08-10

---

**Enable PAC mode or custom routing rules in clients like V2rayX, Shadowrocket, or Clash to route only selected apps or domains through the proxy while keeping other traffic direct.**

The **bannedbook/fanqiang** repository maintains open-source proxy configurations and client setups for bypassing network restrictions across macOS, iOS, Android, and Windows. Split tunneling allows you to send only specific traffic through your proxy while keeping other connections direct, reducing latency and saving bandwidth.

## macOS: Configure Split Tunneling with V2rayX PAC Mode

On macOS, the V2rayX client implements split tunneling through **PAC (Proxy Auto-Config) mode**. According to the repository documentation in [[`macos/V2rayX.md`](https://github.com/bannedbook/fanqiang/blob/main/macos/V2rayX.md)](https://github.com/bannedbook/fanqiang/blob/master/macos/V2rayX.md#L102), enabling PAC mode configures the client to automatically distinguish between domestic and overseas websites, routing only the latter through the proxy node.

To enable split tunneling:

1. Open V2rayX and add your subscription URL.
2. Click the menu bar icon and select **Configure** to save your settings.
3. Click the menu icon again and select **PAC mode** (PAC模式).
4. Choose a specific node (e.g., Taiwan-NF) and click **Load core**.

```bash

# V2rayX menu flow after configuration:

# Menu Icon → PAC mode → Select Node → Load core

# Traffic now splits automatically based on the built-in PAC rules

```

The PAC file contains domain lists that determine which requests are proxied and which connect directly.

## iOS: Split Tunneling in Shadowrocket and Quantumult

iOS clients in the Fanqiang repository provide granular control over split tunneling through custom rule sets and subscription-based routing configurations.

### Shadowrocket Custom Rules

Shadowrocket ships with default split-routing logic that can be customized per-app or per-domain. The documentation in [[`ios/Shadowrocket.md`](https://github.com/bannedbook/fanqiang/blob/main/ios/Shadowrocket.md)](https://github.com/bannedbook/fanqiang/blob/master/ios/Shadowrocket.md#L85) explains how to modify the default rule list to fine-tune which traffic flows through the proxy.

To configure specific app routing:

```text
1. Open Shadowrocket → Settings → "分流规则" (Split Rules)
2. Tap "编辑" (Edit) → Add Rule
3. Configure as follows:
   Type: DOMAIN-SUFFIX
   Value: google.com
   Action: Proxy
4. Save and enable the rule

```

### Quantumult Split Rule Subscriptions

For Quantumult and Quantumult X, the repository provides dedicated split-routing rule subscriptions. As documented in [[`ios/Quantumult_sub.md`](https://github.com/bannedbook/fanqiang/blob/main/ios/Quantumult_sub.md)](https://github.com/bannedbook/fanqiang/blob/master/ios/Quantumult_sub.md#L53), users add these subscriptions to the **分流** (Split Tunneling) section to automatically apply routing policies.

```text

# Adding a split-rule subscription in Quantumult X:

1. Open Quantumult X → "分流" (Split) → "+" → "分流" (Split)
2. Paste the rule subscription URL (e.g., https://example.com/rules.conf)
3. Confirm to auto-apply the split-tunneling configuration

```

## Android: Per-App Routing with Clash

Android implementations use the Clash core with YAML-based rule configurations. The [[`android/clash.md`](https://github.com/bannedbook/fanqiang/blob/main/android/clash.md)](https://github.com/bannedbook/fanqiang/blob/master/android/clash.md) file documents how to define split-tunneling policies using domain suffixes, keywords, and GEOIP databases.

Add the following rules to your [`config.yaml`](https://github.com/bannedbook/fanqiang/blob/main/config.yaml) to enable split tunneling:

```yaml

# ~/.config/clash/config.yaml

rules:
  - DOMAIN-SUFFIX,google.com,Proxy
  - DOMAIN-KEYWORD,cdn,Proxy
  - GEOIP,CN,DIRECT
  - MATCH,DIRECT

```

Enable the **Rule** mode in the Clash for Android interface. This configuration sends Google and CDN traffic through the proxy while directing all Chinese IP traffic (GEOIP,CN) and other traffic directly to the destination.

## Windows: Rule-Based Split Tunneling

Windows users can implement split tunneling through Clash for Windows or SSTap. The repository's [[`windows/ClashDotNetFramework.md`](https://github.com/bannedbook/fanqiang/blob/main/windows/ClashDotNetFramework.md)](https://github.com/bannedbook/fanqiang/blob/master/windows/ClashDotNetFramework.md) and [[`windows/SSTap.md`](https://github.com/bannedbook/fanqiang/blob/main/windows/SSTap.md)](https://github.com/bannedbook/fanqiang/blob/master/windows/SSTap.md) document how to import PAC files or define custom YAML rules similar to the Android implementation.

In Clash for Windows:

1. Navigate to **Settings** → **Rule** → **Import PAC**.
2. Select your PAC file or configure rules directly in the YAML editor.
3. Toggle **PAC mode** to enable domain-based split tunneling.

```yaml

# Example rule snippet for Windows Clash

rules:
  - DOMAIN-SUFFIX,github.com,Proxy
  - DOMAIN-SUFFIX,baidu.com,DIRECT
  - IP-CIDR,127.0.0.0/8,DIRECT

```

## Summary

- **PAC mode** in V2rayX ([`macos/V2rayX.md#L102`](https://github.com/bannedbook/fanqiang/blob/master/macos/V2rayX.md#L102)) provides automatic split tunneling on macOS by distinguishing domestic from overseas traffic.
- **Shadowrocket** ([`ios/Shadowrocket.md#L85`](https://github.com/bannedbook/fanqiang/blob/master/ios/Shadowrocket.md#L85)) supports custom per-app and per-domain rules for iOS devices.
- **Quantumult** ([`ios/Quantumult_sub.md#L53`](https://github.com/bannedbook/fanqiang/blob/master/ios/Quantumult_sub.md#L53)) uses subscription-based split-rule lists to manage routing policies.
- **Clash** configurations on Android and Windows rely on YAML rule sets with `DOMAIN-SUFFIX`, `GEOIP`, and `IP-CIDR` directives to control traffic flow.

## Frequently Asked Questions

### How does PAC mode work for split tunneling?

PAC mode uses a JavaScript-based Proxy Auto-Config file that the operating system consults before establishing connections. The PAC file contains logic that returns "DIRECT" for domestic domains and "PROXY" for blocked overseas sites, effectively splitting your traffic without manual configuration of individual apps.

### Can I route only specific apps through the proxy while keeping others direct?

Yes. Advanced clients like Shadowrocket, Quantumult X, and Clash support **per-app routing** (sometimes called "app rules" or "bundle ID filtering"). You can create rules that match specific application identifiers to the Proxy action while setting a default DIRECT action for all unmatched traffic.

### What is the difference between global mode and split tunneling mode?

**Global mode** forces all system traffic through the proxy tunnel, which may slow down domestic websites and consume unnecessary bandwidth. **Split tunneling mode** (PAC or Rule mode) inspects each connection request against a rule list, sending only matched traffic through the proxy while allowing direct connections for everything else, optimizing performance and access speed.

### Where are the routing rules stored in the Fanqiang repository?

Routing configurations and split-tunneling documentation are platform-specific: macOS guides are in [[`macos/V2rayX.md`](https://github.com/bannedbook/fanqiang/blob/main/macos/V2rayX.md)](https://github.com/bannedbook/fanqiang/blob/master/macos/V2rayX.md), iOS configurations reside in [[`ios/Shadowrocket.md`](https://github.com/bannedbook/fanqiang/blob/main/ios/Shadowrocket.md)](https://github.com/bannedbook/fanqiang/blob/master/ios/Shadowrocket.md) and [[`ios/Quantumult_sub.md`](https://github.com/bannedbook/fanqiang/blob/main/ios/Quantumult_sub.md)](https://github.com/bannedbook/fanqiang/blob/master/ios/Quantumult_sub.md), while Android and Windows implementations are documented in [[`android/clash.md`](https://github.com/bannedbook/fanqiang/blob/main/android/clash.md)](https://github.com/bannedbook/fanqiang/blob/master/android/clash.md), [[`windows/ClashDotNetFramework.md`](https://github.com/bannedbook/fanqiang/blob/main/windows/ClashDotNetFramework.md)](https://github.com/bannedbook/fanqiang/blob/master/windows/ClashDotNetFramework.md), and [[`windows/SSTap.md`](https://github.com/bannedbook/fanqiang/blob/main/windows/SSTap.md)](https://github.com/bannedbook/fanqiang/blob/master/windows/SSTap.md).