Shadowrocket On Demand Setup: Wi-Fi, Cellular, and Domain-Based VPN Triggers

Set up On Demand to connect or disconnect automatically based on Wi-Fi networks, cellular data, and domains. Learn rule order and how to troubleshoot unexpected triggers.

At a glance

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.

Network conditions change On Demand condition matches System establishes tunnel Request routing is evaluated Target connection is established

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.

2 layers
Check the tunnel connection first, then how requests are routed
4 types
Global Routing:Proxy / Direct / Config / Scene
2 stages
App settings: Settings → On Demand

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.

  1. 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.
  2. In Config, select the configuration file you want to use, then set Global Routing on Home to a handling mode you have verified.
  3. 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.
  4. 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.

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 configureWhat to enterWhen it applies
On Demand domain evaluationDomains and connection evaluation conditions required by the interfaceThe system decides whether to establish a connection
DOMAIN-SUFFIX in ConfigDOMAIN-SUFFIX,example.com,PROXYMatches requests by domain after the tunnel is up
IP-CIDR in ConfigIP-CIDR,192.168.0.0/16,DIRECTMatches requests by destination IP range
FINAL in ConfigFINAL,DIRECTHandles 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.

  1. Temporarily disable broad network conditions that establish the tunnel unconditionally, so they don’t mask the domain evaluation result.
  2. Save the domain-related settings, confirm the tunnel is disconnected, then reopen the test app and make a new request to the domain.
  3. 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.
  4. 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.

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 actionWhat to checkWhat to check first if it doesn’t match
Connect to the specified home SSIDThe Disconnect exception matchesSSID spelling and rule order
Turn off Wi-Fi and use cellular dataA request triggers a connection under the cellular conditionCellular condition, mobile data permission, and current connection
Connect to another Wi-Fi networkBehavior matches whether a general Wi-Fi condition is configuredCheck for an overly broad connection condition
Turn off On Demand and disconnect manuallyThis set of On Demand rules no longer reconnects automaticallyCheck 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.

Download Shadowrocket for all platforms