On Demand controls when the system establishes or disconnects a VPN tunnel; it does not decide which route each website takes. This guide covers Shadowrocket on iPhone and iPad, including network conditions, SSID exceptions, cellular rules, and the limits of domain evaluation in Settings → On Demand. It also explains how to test rules in order and temporarily disable them. For users who can already connect manually and want to automate connections.
On Demand vs. Global Routing
On Demand controls connections: when network conditions change or an evaluation condition is met, the system processes the VPN connection according to saved rules. Global Routing handles traffic: once the tunnel is up, the current routing mode and configuration determine where requests go. An automatic connection does not mean every request uses a proxy; selecting Proxy manually does not enable On Demand.
Check Global Routing in Home. Proxy, Direct, Config, and Scene are routing modes, not four types of On Demand trigger. When testing auto-connect, keep the same verified Config selected. Changing network conditions and routing modes at the same time makes it harder to identify where a failure occurs.
Before you begin: establish a manual connection baseline
Automation cannot fix incorrect server settings, an expired subscription, or an unavailable network. First, test manually using the same server, Config, and test destination. A successful test should confirm both that the system shows the VPN as connected and that a real request completes—not just that the connection toggle changes color.
- In Home, select a configured server. If you use a subscription, confirm that it updated successfully and that the selected server is still available.
- Open Config and make sure the expected configuration is active. Return to Home and set Global Routing to Config.
- Turn on the connection manually and allow the VPN configuration when prompted. Run Connectivity Test in Home, then use a browser to open a test page that normally works for you.
- Repeat the test on both Wi-Fi and cellular. Record the network type, VPN status, test destination, and result to rule out problems with either network.
- Open Settings → On Demand and review the existing rules before adding network conditions. Available fields and actions depend on the installed version; do not try to create options that are not in the interface.
If the device is managed by an organization, system VPN settings may be restricted. Other active VPN configurations can also compete for the connection. Before testing network changes, confirm that the system has selected the Shadowrocket configuration. Do not delete existing configurations before recording their settings.
Set rules by Wi-Fi name: put specific SSID exceptions first
A Wi-Fi name is an SSID, not a router’s admin address or your device’s name. In this example, Home-Lab stands for a home network name you have verified; it is not a name to copy. An SSID identifies a network environment, not a network’s identity—different devices can broadcast the same name.
- Check the full name of the connected network in system Wi-Fi settings, including spaces, hyphens, and capitalization. Then open Settings → On Demand.
- Choose a Wi-Fi network condition in the rule editor. To avoid keeping the VPN connected on a particular SSID, set a Disconnect action for that SSID.
- If you also want auto-connect on other Wi-Fi networks, add a general Connect rule for Wi-Fi and place the specific SSID exception before it.
- After saving, disconnect from that Wi-Fi and join it again. Check the system VPN status. Then connect to another known-working Wi-Fi network to test the general rule.
Specific Wi-Fi exception
- Setting
- Settings → On Demand
- Network condition
- Wi-Fi, SSID: Home-Lab
- Action
- Disconnect
- Order
- Before the general Wi-Fi rule
Use this exception only if you specifically want the VPN disconnected on this network; a home network does not necessarily need a Disconnect rule.
Connect on other Wi-Fi networks
- Setting
- Settings → On Demand
- Network condition
- Wi-Fi, any SSID
- Action
- Connect
- Order
- After the specific SSID exception
These settings define a network-level connection policy. They do not determine whether a particular website uses a proxy or connects directly.
Public Wi-Fi may require sign-in through a web page. If the sign-in page does not appear after the tunnel connects, temporarily disable On Demand and disconnect the VPN, complete network sign-in, then re-enable it. Do not assume all public hotspots should always use Disconnect, and do not change DNS or server settings at random to get through sign-in.
Set cellular rules: test separately from Wi-Fi conditions
Cellular rules match the network interface type, not your data plan name or the label assigned to a SIM. If you want the VPN to connect automatically after leaving a particular Wi-Fi network, account for cellular rules too. A rule for “other Wi-Fi” alone does not cover mobile networks.
- Connect on cellular: In Settings → On Demand, add a cellular network condition and choose Connect. Keep any specific Wi-Fi exceptions; they match a different network type.
- Disconnect on cellular: Add an explicit Disconnect condition and check the system status after switching networks. Do not assume that no matching rule will automatically disconnect the VPN.
- Using another device’s hotspot: Your device usually treats this as a Wi-Fi connection. Do not troubleshoot it using your device’s cellular conditions just because the hotspot gets its internet over mobile data.
- Switching SIMs or weak signal: First confirm that cellular data works on your device. On Demand can initiate a connection, but the VPN still needs to complete its handshake; it does not guarantee uninterrupted requests while the network switches.
For testing, leave cellular data on and turn off Wi-Fi. Wait for the network switch to finish, then send a new request. Rejoin the specified SSID and check whether its exception applies. System status changes and new requests may not happen at the same time, so a momentary icon change in the status bar does not prove the entire rule set is working.
Domain-based triggers: routing rules do not start connections
Domain-based On Demand and Connect rules for network types are different mechanisms. Apple’s on-demand VPN model can use EvaluateConnection to assess connection needs by domain, with Connect If Needed and Never Connect as evaluation actions. Connect If Needed does not mean “connect whenever this domain is seen”; it depends on the system’s assessment of domain resolution or reachability.
To determine whether these conditions can be edited directly in Shadowrocket, check the actual rule editor in Settings → On Demand. Configure them only if the interface provides domain evaluation fields. If it only offers conditions such as Wi-Fi and cellular, do not put a domain in the SSID field or assume that adding it to Config enables this feature.
- Start by clarifying the goal: if you only want a proxy for specific websites, keep the tunnel connected and configure domain routing in Config instead of relying on a domain to start the tunnel.
- If you need domain-based connection evaluation, first check whether Settings → On Demand offers the relevant rule and action. If available, enter the target hostname, such as
portal.example.com, in the domain field. Do not includehttps://, a port, or a page path. - Choose a match scope as described by the editor. Do not assume patterns such as
*.example.comare universal syntax. The domain field is not an input for aDOMAIN-SUFFIXrule. - Check whether a Connect or Disconnect rule covering the current network appears before the evaluation rule. If an earlier rule matches, the later domain evaluation will not get a chance to apply.
- Test with a hostname you control. Browser and system DNS caches, in-app DNS, or existing connections may prevent a new system domain evaluation. Reloading the same page alone is not conclusive.
Likewise, GEOIP, IP-CIDR, and FINAL handle routing match conditions and fallback behavior; they are not Wi-Fi or cellular triggers. If the goal is “connect directly to other websites and use a proxy for specific domains,” organize the rules in Config and test with Config mode instead of repeatedly toggling On Demand.
Rule order: handle exceptions before broad conditions
The system evaluates On Demand rules in order. The first matching rule determines how that evaluation is handled; actions are not combined across all rules. Specific network exceptions generally belong before general conditions. Do not sort rules mechanically by name—the important factor is each rule’s matching scope.
| Order | Match condition | Action | Expected result |
|---|---|---|---|
| 1 | Wi-Fi, SSID: Home-Lab | Disconnect | Do not keep the VPN connected on this specific network. |
| 2 | Wi-Fi, any SSID | Connect | Other Wi-Fi networks match this rule and initiate a connection. |
| 3 | Cellular | Connect | Initiate a connection when the device switches to cellular data. |
The table shows example rules for network types and does not include domain evaluation. If you move rule 2 above rule 1, Home-Lab will match the general Wi-Fi condition first and the exception will no longer apply. To add domain evaluation, redesign overlapping scopes: placing it after a Connect rule that already covers the same network will not make domain evaluation happen first.
- Move only one rule at a time. After saving, trigger the corresponding network change again.
- Do not assume that no matching rule automatically runs Disconnect. Use an explicit action when you need to disconnect.
- Check for conditions that cover every network. If one appears first, later, more specific rules may never match.
Manual toggle and On Demand: what happens after disconnecting
A manual disconnect is a one-time action; On Demand is a connection policy the system retains. While On Demand rules are enabled, a later network event or qualifying request may trigger another connection. If the VPN reconnects after you turn it off, check the On Demand policy first rather than assuming the toggle is broken.
Why does the VPN reconnect after I turn it off in Home?
First, disable On Demand in Settings → On Demand and save, then return to Home and disconnect. Next, find the VPN configuration for Shadowrocket in system settings and check the Connect On Demand status. The system settings menu name may vary by OS version; check the details for the relevant VPN configuration.
Where do I change whether a specific Wi-Fi network connects automatically?
First, confirm that the current SSID exactly matches the name in the rule. Then check that its Disconnect rule appears before the general Wi-Fi Connect rule. After saving, leave the network and rejoin it; do not just change the name and judge the result while the existing connection remains active.
The VPN shows as connected, but web pages will not load. Did the trigger fail?
Record tunnel establishment and request success separately. Run Connectivity Test in Home, check that Global Routing is still set to the expected Config, and confirm that the selected server is available. On Demand starts the connection; it cannot guarantee that server routing or DNS resolution will work.
Do I have to delete all the rules to disable On Demand temporarily?
Usually not. Record the current rule order, disable On Demand, and disconnect manually. Before re-enabling it, confirm that the server and Config work. This preserves network exceptions you have already tested.
Final checks: test three scenarios and keep a record
After setup, test at least three scenarios: the specified Wi-Fi, another Wi-Fi network, and cellular. Use the same test destination and record the network switch time, whether the VPN connected, and whether the request succeeded. These are checks to perform, not pre-reported test results; fill in your own observations from the device.
- Specified Wi-Fi: Rejoin the actual network represented by Home-Lab and check that the specific SSID exception applies. If you use the example rule, you should see the status associated with Disconnect.
- Other Wi-Fi: Join another network where you have completed sign-in, send a new request, and check that Connect starts the tunnel and the page loads correctly.
- Cellular: Turn off Wi-Fi, confirm cellular data works, and repeat the connection and request tests. Then rejoin the specified Wi-Fi and check that its exception still takes priority.
- Temporary disable: Disable On Demand, disconnect manually, and repeat a network switch to make sure no active On Demand rule is affecting the test.
If a test fails, revisit the rule you changed most recently. Do not change DNS, server protocols, and routing settings all at once. If the network condition matches but the tunnel cannot connect, check the connection settings first. If the tunnel is up but requests fail, check Config, DNS, and server availability. Troubleshooting layer by layer makes it easier to preserve evidence than repeatedly reinstalling the app.
How to get Shadowrocket and complete the initial setup
The iPhone and iPad version is available on the App Store for a one-time payment of $2.99. The Mac (Apple Silicon and Intel), Windows, Android, and Linux versions are free. For iPhone and iPad system requirements, check the App Store listing. Install the app and verify a manual connection before setting up On Demand as described here.