HTTP Rule
There are 3 HTTP rule types. HTTP rule is for HTTP requests or HTTPS requests. It won't effect TCP connections.
USER-AGENT
USER-AGENT,Instagram*,DIRECT
Rule matches if the user agent of the request matches. Wildcard characters * and ? are supported.
URL-REGEX
URL-REGEX,^http://google\.com,DIRECT
Rule matches if the URL matches the regular expression.
PROTOCOL
PROTOCOL,HTTPS,Proxy
Rule matches if the detected protocol of the connection matches. Use in combination with sniffing-enabled for best results.
Supported protocol values:
| Value | Description |
|---|---|
HTTP |
HTTP request |
HTTPS |
HTTPS/TLS connection |
TLS |
TLS connection (any TLS, including non-HTTPS) |
TCP |
Plain TCP connection |
UDP |
UDP traffic |
QUIC |
QUIC protocol |
STUN |
STUN protocol (WebRTC) |
DNS |
DNS query |
DOH |
DNS-over-HTTPS |
DOQ |
DNS-over-QUIC |
SCRIPT
SCRIPT,MyRuleScript,DIRECT
Rule evaluates a JavaScript script for custom matching logic. The script name must match a script defined in the [Script] section with type=rule.
[Rule]
SCRIPT,CheckInternal,PROXY
[Script]
CheckInternal = type=rule, script-path=internal-check.js
The rule script receives $request and must call $done({matched: true}) or $done({matched: false}). The requires-resolve option can be used with SCRIPT rules to ensure DNS resolution has occurred before script evaluation.