User-Agent Rules
User-Agent rules allow you to route HTTP traffic based on the User-Agent header of the request. This rule type only works for HTTP/HTTPS traffic handled by the System HTTP Proxy.
Example
# Routes Instagram app traffic through DIRECT
USER-AGENT,Instagram*,DIRECT
# Blocks curl requests
USER-AGENT,*curl*,REJECT
# Routes Apple TV traffic through a specific proxy with remote DNS
USER-AGENT,Apple*TV,Proxy,force-remote-dns
Format
USER-AGENT, {pattern}, {target proxy}[, force-remote-dns][, enhanced-mode]
Parameters
| Name | Value | Mandatory | Note |
|---|---|---|---|
| pattern | - | true | User-Agent pattern to match. Supports wildcard characters * (matches any sequence) and ? (matches any single character). |
| target proxy | - | true | The specified proxy or proxy group must exist in the profile. |
| force-remote-dns | true false | false | Default value: false. If set to true, the DNS query will be triggered on the remote proxy. |
| enhanced-mode | true false | false | Default value: false. If set to true, a fake IP will be returned in the DNS query. |
caution
Requirements:
- Android Version: User-Agent rules require Android 10+ (because they depend on System HTTP Proxy).
- Settings: You must enable "Enable VPN HTTP Proxy" in VPN Settings for User-Agent rules to work.
- Traffic Type: User-Agent rules only work for HTTP/HTTPS traffic handled by System HTTP Proxy. They do not apply to:
- TCP traffic routed directly through the VPN tunnel
- UDP traffic
- DNS queries
force-remote-dns and enhanced-mode attributes only work on Android 11 and above.
tip
Common User-Agent patterns:
Instagram*- Matches Instagram app requests*curl*- Matches curl tool requestsMozilla*- Matches Mozilla browser requests?ozilla*- Matches any browser with "ozilla" in the name (Mozilla, Lozilla, etc.)
See Also
- DOMAIN - Domain-based routing rules
- PROCESS-NAME - Application-based routing rules
- FINAL - Final catch-all rule