Map to remote
This is an example of alteration rule among many others. You can explore all rules available at Settings > Manage rules > Add a new rule.
Map to remote allows you to redirect HTTP/HTTPS requests to a different URL. This is useful for testing against different environments (staging, development), mocking third-party APIs, or routing traffic to local development servers. This feature is implemented through the forward request action.
Unlike DNS spoofing, the forward action automatically handles host header management and supports protocol conversion between HTTP/HTTPS and HTTP/1.1/HTTP/2.
Creating a forward rule
Open rule management in one of the following ways:
- Settings menu > manage rules
- Status bar > active rule
Ctrl+TorCmd+Tto access the search everywhere tool, then typeManage rules
Click on
Add a new rulebuttonSearch for
forwardand selectForward requestFill the form:
- URL: The destination URL where requests will be forwarded (must be an absolute URL, e.g.,
https://staging.example.com)
- URL: The destination URL where requests will be forwarded (must be an absolute URL, e.g.,
Choose a filter. The specified action will only be applied to requests that match the filter. For example:
- Select
Host filterand enterapi.production.comto forward only requests to that specific host - Or select
Any requeststo forward all traffic
- Select
Save everything, now the rule should appear on rule management dialog
Common use cases
Redirect production API to local server
Forward API requests to your local development server:
- Filter: Host filter with
api.production.com - Forward URL:
http://localhost:3000
Test against staging environment
Redirect requests from production to staging:
- Filter: Host filter with
www.example.com - Forward URL:
https://staging.example.com
Protocol switching
Forward HTTP requests to HTTPS endpoints (or vice versa):
- Filter: Full URL filter with
http://legacy-api.example.com - Forward URL:
https://new-api.example.com
YAML configuration
You can also configure forwarding via YAML rules:
rules:
- filter:
typeKind: HostFilter
pattern: api.production.com
actions:
- typeKind: ForwardAction
url: http://localhost:3000
For more information about importing YAML rules, see importing YAML rules.