hiddify.st
EN

Where in the appSettings → Routing

Routing rules: what goes direct, what goes through the proxy

How the rule editor on Hiddify 5.9's routing page works: domain, suffix, keyword, IP CIDR, port, process and package fields, the four outbounds proxy, direct, direct with fragment and block, copying built-in rules to edit them, and importing and exporting rules.

At the top of Settings → Routing is the region, and below it the rule list. Pick a region and Hiddify adds a set of built-in rules; below them you can add your own, down to a single domain, app or port.

Built-in rules

Built-in ruleWhat it does
Bypass LANRouter, NAS, printer and other local addresses go direct
Apple / Microsoft / Android servicesSystem updates and push go direct, saving traffic and staying stable
Linux updatesLinux package mirrors go direct
Ads and malwareBlocked by list
Sites in (your region)Local sites go direct, such as Chinese sites when China is selected

Built-in rules cannot be changed directly; the screen says to duplicate and edit the copy. Tap Duplicate rule, change the copy, and switch the original off if needed.

Signposts at a junction: every rule is a sign that says where to go
Signposts at a junction: every rule is a sign that says where to go nick macneill, CC BY-SA 2.0

Adding your own rule

Tap Add rule, give it a name, then pick Outbound if match:

  • Proxy: through the server you selected.
  • Direct: without the proxy.
  • Direct with fragment: without the proxy, but the TLS handshake is split before sending, for sites blocked by name whose IP is not blocked. See this article.
  • Block: cut off.

Then fill in the conditions. There are many; the common ones are:

FieldWhat to enterExample
DomainFull domain, matches only itselfdl.google.com
Domain suffixA suffix, matches subdomains tooexample.com, .ir
Domain keywordA piece of text in the domaingoogle
Destination IP CIDRAn IP or range10.0.0.0/8, fd00::/8
Destination portsA port or range80, 1:65000
Process names (computers)Program file namechrome.exe
Package names (Android)App package nameorg.telegram.messenger
URLset (rule set)A remote rule listhttps://…/xxx.srs

Process and package conditions work only in VPN mode, and the screen marks them “Available only in TUN mode”. For a batch of domains, sort them first with the rule sorter and then paste.

How conditions combine

Within one rule, domains, suffixes, keywords and IPs match if any one matches; ports, network (TCP/UDP), protocol and similar conditions must match together with the address. So “example.com + port 443” matches only port 443 on example.com. For an “or”, split it into two rules.

  1. Top to bottom, one by oneThe first matching rule wins; later ones are not checked
  2. Nothing matchesDefault outbound: proxy
  3. Direct trafficSkips the proxy; DNS uses the outbound resolver
How rules are checked

Import, export and reset

The rule list menu has Copy rules to clipboard and Save rules to file, and can import from the clipboard or a file, which makes it easy to sync between phone and computer. If you make a mess, use Reset to default rules.

A rule does nothing?

First check whether you are in system proxy mode: programs that ignore the system proxy never reach Hiddify. Then check the order, in case a broader rule above matches first.

Where are “balancer strategy” and “default proxy”?

Also lower on the routing page. They decide what is used before you pick a server and how connections are spread over several servers; see this article.

Read nextDNS: who looks up the names