Shadowrocket On Demand lets the system establish or disconnect a VPN tunnel based on set conditions; it does not replace traffic-routing rules that apply after connecting. This guide uses Settings → On Demand on iPhone / iPad to show how to verify a manual connection first, configure conditions for specific Wi-Fi networks, cellular data, and domains, then troubleshoot each condition by switching networks. It’s for users who already have a connection configuration and want to reduce manual switching. Menus and system behavior may differ on other platforms.
On Demand vs. Global Routing
On Demand determines when to establish a tunnel; Global Routing determines how to handle traffic after the tunnel is up. A VPN Connected status does not mean every request goes through a proxy. If a rule sends a domain to DIRECT, that request can connect directly even while the tunnel remains active.
Check Global Routing on Home. Proxy, Direct, Config, and Scene are different handling modes: Proxy routes traffic through a proxy, Direct connects directly, Config follows the selected configuration, and Scene depends on the configured scene. When troubleshooting On Demand, start with a Config and configuration file you have already verified. Avoid changing both trigger conditions and outbound routing at the same time.
This guide covers using connections and configurations you already have. This site does not provide, sell, or recommend proxy nodes or subscriptions. On Demand does not create a working connection or fill in server addresses, credentials, or protocol settings if your existing configuration stops working.
Make a manual connection before configuring On Demand
Turn off On Demand, select an imported, working connection on Home, and switch it on manually. The first time you connect, allow the VPN configuration when prompted by the system. If you previously denied permission, resolve that first instead of adding more automatic connection conditions. If a manual connection does not work, automatic triggers will only repeat the same failure.
- On Home, check the selected connection and confirm it belongs to a configuration you own and that still works. If it was imported from a subscription, update it first, then check that the connection is still available.
- In Config, select the configuration file you want to use, then set Global Routing on Home to a handling mode you have verified.
- Turn the connection on manually, visit a page you know works, then visit a destination that should be handled by your existing configuration. Check the result for each.
- Disconnect manually and confirm that the system connection status changes. Then go to Settings → On Demand and configure your first condition.
Connection settings for Shadowsocks, VMess, VLESS, Trojan, Hysteria2, and WireGuard are separate from On Demand conditions. A matching On Demand rule does not guarantee that the selected protocol can connect on the current network. Check server reachability, credentials, and transport requirements separately.
Set conditions for Wi-Fi networks and cellular data
In Settings → On Demand, add specific network exceptions first, followed by broader conditions. The example goal is to keep the tunnel off on a specific home Wi-Fi network and connect automatically on cellular data. If actions are shown in English as Connect or Disconnect, choose the one that matches your goal. Editable fields and available actions depend on the current interface; the table below is not an importable configuration file.
Specific Wi-Fi exception
- Setting
- Settings → On Demand
- Network type
- Wi-Fi
- Example SSID
- Home-5G
- Desired action
- Disconnect
- Rule order
- Before the general Wi-Fi condition
Home-5G is only an example. Replace it with the actual SSID your device is connected to.
Cellular connection
- Setting
- Settings → On Demand
- Network type
- Cellular network
- SSID condition
- Not used to match cellular networks
- Desired action
- Connect
- How to verify
- Turn off Wi-Fi and make a network request
The cellular rule controls the trigger condition; it does not replace connection settings or traffic-routing rules.
An SSID is a network name, not a router’s admin address. Enter it exactly as shown, including capitalization, spaces, and symbols. Don’t change a full name into a prefix match. If your home router broadcasts separate names such as Home-2G and Home-5G, add both to the conditions you need instead of assuming one will cover the other.
- Specific Wi-Fi exception: Place it before a broad Wi-Fi connection condition so the general rule doesn’t match first.
- Other Wi-Fi networks: Add a general condition if you want automatic connections. If you don’t, don’t add an all-matching connection condition just for the sake of completeness.
- Cellular data: Test it separately. Switching between two Wi-Fi networks is not a substitute for a cellular test.
- Save and enable: Save your conditions, then check that On Demand is enabled both in Shadowrocket and in the system VPN configuration.
The system evaluates On Demand rules in order. A broad condition near the top can prevent a more specific condition later from taking effect. An SSID is not proof of network identity: networks with the same name may exist in different places, so don’t trust a network based on its name alone. Before setting a Disconnect exception, make sure you don’t need the tunnel for access on that network.
Troubleshooting approach: start narrow, then widen the scope
Keep only the specific SSID and cellular conditions at first, and test each one by switching networks. Once both behave as expected, add an “Other Wi-Fi” rule. This makes it easier to spot rules that override one another.
Domain triggers are not the same as DOMAIN-SUFFIX routing
The system handles domain-based On Demand evaluation. It does not mean Shadowrocket continuously reads every web address while the tunnel is off. If the current On Demand editor offers EvaluateConnection or a domain evaluation option, configure it there. If it doesn’t, don’t enter a domain in the Wi-Fi name field or expect domain rules in Config to become connection triggers automatically.
| Where to configure | What to enter | When it applies |
|---|---|---|
| On Demand domain evaluation | Domains and connection evaluation conditions required by the interface | The system decides whether to establish a connection |
| DOMAIN-SUFFIX in Config | DOMAIN-SUFFIX,example.com,PROXY | Matches requests by domain after the tunnel is up |
| IP-CIDR in Config | IP-CIDR,192.168.0.0/16,DIRECT | Matches requests by destination IP range |
| FINAL in Config | FINAL,DIRECT | Handles requests that did not match earlier rules |
Domain fields usually take a hostname, not a full URL with a scheme, path, and parameters. For example, use example.com to represent a sample domain; don’t include a page path. Check the option’s matching instructions to see whether it includes subdomains or requires separate entries. This example domain only illustrates the format; it does not imply that it needs a proxy on any network.
The system’s domain evaluation may depend on DNS resolution, reachability checks, and configured evaluation conditions. Visiting any chosen domain does not necessarily trigger a connection immediately. Browser caches, an app’s own resolution method, requests made directly to an IP address, and existing connections can all prevent a new system domain evaluation. Refreshing an already-open page alone therefore can’t prove that domain triggering works or doesn’t work.
- Temporarily disable broad network conditions that establish the tunnel unconditionally, so they don’t mask the domain evaluation result.
- Save the domain-related settings, confirm the tunnel is disconnected, then reopen the test app and make a new request to the domain.
- Check both the system VPN status and the result of the request. If the tunnel is up but the destination fails, troubleshoot the configuration and outbound connection.
- If you can’t reproduce the behavior consistently, use a clear network-type condition first, then check whether the system actually followed the expected domain resolution process.
Check Config rules and DNS after connecting
If switching networks now establishes the tunnel automatically but web traffic still doesn’t behave as expected, stop changing On Demand. Check Global Routing on Home, then review the active rules in Config. Rules generally match in order; putting FINAL first can prevent later domain or IP-range rules from working as intended.
[Rule]
DOMAIN-SUFFIX,example.com,PROXY
IP-CIDR,192.168.0.0/16,DIRECT
GEOIP,CN,DIRECT
FINAL,DIRECT
This example shows rule syntax and order only; it is not a complete configuration for every user. DOMAIN-SUFFIX matches domain suffixes, IP-CIDR matches IP ranges, GEOIP matches against IP location data, and FINAL handles anything left over. GEOIP does not identify a location based on a website’s language, and it does not control whether the VPN starts automatically.
- Tunnel not established: Check the On Demand conditions, the master switch, and system VPN permission.
- Tunnel established, all destinations fail: First verify that the current connection works, then check DNS and network restrictions.
- Only some domains fail: Check which rule matched, the DNS results, and whether the destination itself is reachable.
- Local devices are unreachable: Check the actual local subnet and relevant DIRECT rules. Don’t copy the example subnet blindly.
If a subscription update removes or renames the selected connection, On Demand may still trigger, but the tunnel won’t work as intended. Update and verify the connection on Home first, then test it manually before enabling automatic conditions. Check subscription updates and Config updates separately; they are not necessarily the same operation.
Test network switching and troubleshoot unexpected triggers
After setup, follow a consistent test sequence and record what happens. For each step, note the current network name, VPN status, whether you just made a new request, and the connection selected on Home. These are checks to perform, not guaranteed test results. System scheduling and network transitions take time, so don’t judge by a status-bar icon at a single moment.
| Test action | What to check | What to check first if it doesn’t match |
|---|---|---|
| Connect to the specified home SSID | The Disconnect exception matches | SSID spelling and rule order |
| Turn off Wi-Fi and use cellular data | A request triggers a connection under the cellular condition | Cellular condition, mobile data permission, and current connection |
| Connect to another Wi-Fi network | Behavior matches whether a general Wi-Fi condition is configured | Check for an overly broad connection condition |
| Turn off On Demand and disconnect manually | This set of On Demand rules no longer reconnects automatically | Check whether another system VPN setting is connecting automatically |
Why does it reconnect a little while after I turn it off on Home?
The current network may still match a Connect condition, and a new network request can trigger the system again. To pause automatic connections, turn off On Demand in Settings → On Demand, then disconnect manually. Also check the On Demand status for the relevant VPN configuration in system Settings → General → VPN & Device Management.
I added my home Wi-Fi, so why does it still connect automatically?
Check the actual SSID in system Wi-Fi settings, including spaces and differences in band names. Then move the Disconnect condition for that specific network ahead of any general Wi-Fi condition. Save, leave the network, reconnect, and check the status again.
VPN shows as connected on cellular, but pages still won’t load. Should I change the trigger rules?
If the tunnel is already established, check the outbound connection first. Temporarily turn off On Demand and manually connect to the same configuration on the same cellular network. If it still fails, check the connection on Home, Global Routing, and DNS instead of adding more cellular conditions.
Hotel Wi-Fi requires a login. What if the login page doesn’t appear after it connects automatically?
Turn off On Demand and disconnect the tunnel first. Sign in to the network on the system Wi-Fi page, then test the connection manually. Once it works, enable the On Demand rules again. Don’t treat a network that requires a web login as if it already has internet access.
I keep adding rules. How can I get back to a setup that’s easy to troubleshoot?
Record the current conditions, turn off On Demand, and verify the connection manually. Then enable just one clear network condition and test it. Restore the others one by one after it works. Test domain evaluation separately once the network conditions are stable, so the two mechanisms don’t mask each other.
After changing devices or reinstalling, check VPN permissions and the system’s On Demand status again; don’t just confirm that the connection list has returned. This guide focuses on iPhone / iPad. Check the App Store page for the current system requirements. To get or install a version for another platform, visit this site’s app download page.