This feature is really useful if you want to point your application to a different environment. This can be useful if, for example, you are debugging a Production issue and you need to quickly point your Prod build to a non-Prod environment but want to avoid rebuilding and redeploying the application. It can be a great time saver. You can achieve a similar result by using the Rewrite feature.
In this tutorial we will redirect traffic from an OpenBank API endpoint to a Github gist.
Prerequisites
- Install Charles
- Make sure you have setup the Charles Root certificate on your Mac before you proceed to the next step
Go to the OpenBank API Products’ endpoint
Open Chrome and go to NAB’s Products endpoint
You should now get an error about about a “Missing mandatory header”

Enable SSL Proxying
In Charles, right click the OpenBank request and click the “Enable SSL Proxying” option
The Request(s) you want to modify must be decrypted before you can use the Map Remote feature with it

Reload the page on Chrome
Return to Charles where you should now get a 406 error. Request details should be displayed in plain text

Define what to “Map Remote”
We will send users to a Github Gist page (which is JSON file) every time they go NAB Products’ endpoint
Configure URLs to map to
Click Add and configure as follows:
- In the “From” section paste https://openbank.api.nab.com.au/cds-au/v1/banking/products into the “Host” field
- In the “To” section paste https://gist.githubusercontent.com/charlesdocsy/d50584a1da9a9bece3c7459624c5760a/raw/9d555b254c9c05176c38e8c3a5e59e962c6bbe29/charlesdocsy2.json into the “Host” field
- Click OK to save
- Click OK to close the Map Remote Settings screen

Check the URL has been changed
On Chrome when you go to OpenBank endpoint you should see the data from the Github gist
