Auto routing

RCX is the RainClash server-selection engine: scripted groups pick their own server by profile, and a scenario steers the whole connection.

On this page

In the app

Open Tools → Advanced configuration → Auto routing and choose Scenarios or Scripted groups.

  • Scenarios starts off for each subscription. Turn on Use a scenario and choose one to control its routes, proxy groups and tunnel mode. Use Scenario library to create, edit or import scenarios.

  • Scripted groups lists configured strategies and the existing behaviour library. By default Proxies shows Behaviour for groups with a provider or saved strategy. To script an ordinary subscription group, turn on Allow scripting new groups here, then open Proxies → Behaviour on that group. The switch also reveals Add group on this page. Existing strategies keep running when you turn it off. The form uses list editors for server, group and provider names, and a country picker for exclusions. Edit YAML opens the app's code editor with strategy-specific completion; saving there updates the draft. Preview checks the draft without applying it, and the form's save applies it to the current subscription.

Model

A group strategy chooses an eligible member for each new connection or UDP session and owns the group's selection; an RCX binding for the same group stays stored but does not apply while the strategy runs. Rules and scenarios can target a scripted group by name.

ObjectWhat it isWhere it comes from
Scripted groupA proxy group with a selection strategy.The subscription or the current profile.
ProfileHow one group chooses (the app calls it a behaviour): pool, tiers, ranking, switching, checks, network kinds.Built in, provider, or user.
ScenarioWhole-connection behavior: group programs, routes, tunnel mode per network kind.Same three sources; one per subscription.
RouteRules placed before the config's rules; matched traffic goes to its own group, an existing target, or DIRECT.The running scenario, at config apply.
EvidencePer-server latency samples, failures, check results and exit country.Probes, URL tests and real traffic.
80%
Diagram source
mermaid
flowchart LR
    Profile --> Policy
    Binding[Provider and user bindings] --> Policy
    Program[Scenario program] --> Policy
    Policy --> Decide{{Decide}}
    Evidence --> Decide
    Decide --> Ranking[Ranking and reason]
    Ranking --> Member[Selected member]
    Member -. probes and traffic .-> Evidence

A group's policy is its profile plus the bindings and scenario program. The decision is a pure function of policy, evidence and context; its explanation is the ranking it decided on. See Engine.

Profile and scenario

ProfileScenario
ScopeOne groupThe connection
ChoosesA server among the group's membersProfile, pool, order or fixed member per named group; tunnel mode
Network kindson.<kind> changes the profile's tiers, rank, switching, pool, stranded and energyon.<kind> replaces group programs and the mode
Adds rulesNoYes, via routes (rule mode only)
ReferenceProfilesScenarios

A group the running scenario does not name keeps its binding. With no binding and no program, it is a plain selector.

Identifiers

Profiles and scenarios have separate namespaces, keyed as <source>/<name>.

SourcePrefixEditable
Built inbuiltin/No; edits go to a copy.
Subscription providerprovider/No; edits go to a copy. A bare fast means provider/fast.
Useruser/Yes. Profiles are shared by all subscriptions; the user layer (bindings, scenario, allowed hosts) belongs to one subscription.

Built-in profiles and scenarios

IdLevelBehavior
builtin/simplesimpleOne tier not dead; latency rank, tolerance 50; improve: false, feel calm. Default for groups without a usable profile.
builtin/fastestsimpleLatency rank, tolerance 20; improve: true, feel balanced.
builtin/stablesimpleStability rank, tolerance 100; improve: true, feel calm.
builtin/from-listsimpleextends: builtin/simple; for hand-picked servers, which get pinned.
builtin/bypass-ruadvancedTiers: passes open (https://api.telegram.org/) with a non-RU exit; any non-RU exit; any working server last. Kinds portal (paused) and open; direct split on home fail and foreign ok.
builtin/bypass-ir, builtin/bypass-cnadvancedSame tiers for IR and CN, checked on youtube.com and google.com generate_204; kind portal only.
builtin/whitelist-ruadvancedExtends bypass-ru; adds tag bypass and kind whitelist (home ok and foreign fail); bypass servers first.
builtin/every-group (scenario)—groups: {'*': {}}: every select group except GLOBAL uses scripted selection with its binding’s profile.
builtin/whitelist-ru (scenario)—$main runs bypass-ru without bypass servers; on kind whitelist the mode becomes global and GLOBAL runs simple over bypass servers.

Glossary

TermMeaning
BindingAttaches a profile to a group: profile, default, pool, prefer, feel, energy, chips. See Bindings.
ProgramScenario action on one group: profile, pool, prefer or to.
PoolMembers a group may choose from, after include and exclude.
TierOne prefer entry: a label and a condition; the app calls it a step of the Server order.
FallbackThe last-resort step (last-resort): used only when no other step has a working server.
ToleranceRanking bonus in milliseconds for the current server, against flapping.
StrandedNo eligible member; stranded says what to do.
Network kindNamed network class (portal, whitelist, …) recognized by network conditions.
DiagnosticDirect device probe, outside the tunnel, that recognizes network kinds.
CheckRequest through a server to see whether it opens something (passes(id)).
Exit countryCountry a server's traffic leaves from, agreed by independent sources.
Direct splitRouting DIRECT-matched connections through a scripted group while direct access is broken.
ControlAuto, pinned or manual, per group.
JournalThe last 200 engine events: switches, failures, control, network, mode and direct-split changes.

Minimal example

nearest.rcx.yaml
rcx: 1
title: Nearest working
prefer:
  - { label: Fast, when: 'latency < 150ms' }
  - { label: Any, when: 'not dead' }
rank: { by: latency, tolerance: 30 }
switch: { improve: true, feel: balanced }

The group takes a server under 150 ms if one is measured, else any working server, and switches to a faster one only past the balanced thresholds. Import it in the app or serve it from a subscription; see Sharing.

Searches every section: providers and RCX