Shadowrocket On Demand Setup: Auto-Connect on Wi-Fi, Cellular, and by Domain

Set up On Demand rules for Wi-Fi names, cellular networks, and domains. Learn how rule order affects matching and how On Demand interacts with the manual connection toggle.

At a glance

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.

Network conditions change On Demand rules are evaluated The system establishes a tunnel Routing rules are matched The request is sent

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.

2 types
Network conditions covered: Wi-Fi and cellular
4 types
Global Routing:Proxy / Direct / Config / Scene
2 layers
Check the tunnel first, then how requests are routed

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.

  1. In Home, select a configured server. If you use a subscription, confirm that it updated successfully and that the selected server is still available.
  2. Open Config and make sure the expected configuration is active. Return to Home and set Global Routing to Config.
  3. 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.
  4. 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.
  5. 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.

  1. Check the full name of the connected network in system Wi-Fi settings, including spaces, hyphens, and capitalization. Then open Settings → On Demand.
  2. 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.
  3. 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.
  4. 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.

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.

  1. 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.
  2. 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 include https://, a port, or a page path.
  3. Choose a match scope as described by the editor. Do not assume patterns such as *.example.com are universal syntax. The domain field is not an input for a DOMAIN-SUFFIX rule.
  4. 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.
  5. 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.

OrderMatch conditionActionExpected result
1Wi-Fi, SSID: Home-LabDisconnectDo not keep the VPN connected on this specific network.
2Wi-Fi, any SSIDConnectOther Wi-Fi networks match this rule and initiate a connection.
3CellularConnectInitiate 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.

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Download Shadowrocket