Policies
How Loon routes traffic:
request arrives on the phone → match a rule → look up the policy the rule points to → obtain the node from that policy
This is the relationship between the three concepts: a rule points to a policy, and the policy decides which node is used.
In Loon a policy can be one of three things: a single node, a built-in policy, or a policy group.
Node policy
When a policy is a node, that node forwards the traffic. You can point a rule straight at a node policy:
# suppose you have a node named "HK01"
DOMAIN,google.com,HK01Built-in policies
There are two kinds of built-in policy: direct and reject.
Direct
Traffic bypasses every proxy server and goes straight to its destination. Written as the uppercase DIRECT.
DOMAIN,apple.com,DIRECTReject
As the name suggests, the traffic is never sent anywhere — most commonly used to block ads.
To fit different kinds of request, Loon provides several reject policies:
REJECT— returns a 200 response with an empty bodyREJECT-IMG— returns a 200 response whose body is a 1px GIFREJECT-DICT— returns a 200 response whose body is an empty JSON objectREJECT-ARRY— returns a 200 response whose body is an empty JSON arrayREJECT-DROP— rejects and drops the request without returning any response. Some apps retry very aggressively and would flood you with requests on a failed connection, which is what this variant avoids
