mock_route_setup
Set up a Map Remote rule in Charles Proxy to route a host or domain glob to a local dispatcher, enabling mock traffic while letting unmocked requests pass through unchanged.
Instructions
Send a host (or domain glob) through the dispatcher; once per host/domain. One Charles Map Remote mapping (https:// -> local dispatcher, empty destination path, preserve host header) covers every path and action under it; after that, mocks are only data. Unmocked requests pass through unchanged. apply=true writes the mapping into the Charles config; only while Charles is closed, because Charles overwrites its config from memory on quit. This tool never quits or starts Charles: ask the user to save the session and quit Charles, not to reopen it until the write is done, then to start it. apply=false returns manual steps that work in the UI without a restart.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Hostname or domain glob. Use a glob such as *.example.com when the same API runs on several hosts (dev, stage, ...). | |
| path | No | Path pattern: /* for every path, /api/* for a prefix, or one path. | /* |
| port | No | ||
| apply | No | ||
| verify_tls | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| path | Yes | ||
| applied | No | ||
| warnings | No | ||
| route_file | Yes | ||
| config_path | No | ||
| instructions | No | ||
| config_backup | No | ||
| mapping_added | No | ||
| map_remote_rule | Yes |