Map Remote

1. What's it?

Map Remote would help the developer to change the HTTP Request's location to a new destination server, per the configured rules, so the HTTP Response is transparently served from your client.

Map Remote also supports map from HTTP to HTTPS and vice-versa

⌘⌥R: Map Remote Shortcut

For common user-cases, please check out this tiny tutorial

2. Benefits

  • Use Production Endpoints on your Development website on certain endpoints without changing in the source code

  • Use Development Endpoints on your Production website

  • Change certain request's URL to different destinations

  • Able to replace requests components, such as Protocol, Host, Port, Path or Query on the fly

To boost your productivity, you can use the Scripting feature that allows you to achieve the same result of Map Remote by writing simple Javascript Code

For instance, Snippet code to change Production to Localhost server

3. Matching Rule

Proxyman supports Regular Expression and Wildcard from the 2.3.0 version. Check out here

We can define matching rules by using Wildcard or Regular Expression.

For matched requests, Proxyman attempts to:

  • Replace Protocol, Host, Port, Path, Query if it available

  • If the component is empty, it won't change the matched request's component

  • Leave the Text Field blank to keep it unchanged from the matched request

  • Wildcard is not allow

Additional Headers

If the request is matched, the Response would contain:

  • X-Proxyman-Map-Remote: https://<your_map_remote_url>

Therefore, it's easier to know what is the server that the response serves

Preserve Host Header

By default, Proxyman attempts to override the Host Header to match with the new Host in Remote Map. It's crucial to successfully make a request.

If you would like to preserve the original Host Header, please check ON in "Preserve Host Header" checkbox when creating a new entry. Proxyman will preserve the Host value.

4. How to use

  • Tools Menu -> Map Remote

  • Right Click on selected Request -> Tools -> Map Remote: Proxyman will fill necessary data from the selected request

5. Common Usages

5.1 Map all localhost traffic to HTTPS

  • Rule: http://localhost:3000

  • Select Any and Wildcard

  • Check Include all subpaths of this URL

Map To:

  • Protocol: https

  • Host: your production host (e.g proxyman.io)

  • Port 443

  • Leave Path and Query Empty

Result:

Original URL

To URL

http://localhost:3000

https://proxyman.io

http://localhost:3000/v1/user?id=123&name=proxyman

https://proxyman.io/v1/user?id=123&name=proxyman

5.2 Map HTTPS Production URL to localhost

  • Rule: https://proxyman.io

  • Select Any and Wildcard

  • Check Include all subpaths of this URL

Map To:

  • Protocol: http

  • Host: your local server (e.g localhost:3000, or proxyman.dev (alias domain from /etc/hosts))

  • Port: 3000 (your local port)

  • Leave Path and Query Empty

Result:

Original URL

To URL

https://proxyman.io

http://localhost:3000

https://proxyman.io/v1/user?id=123&name=proxyman

http://localhost:3000/v1/user?id=123&name=proxyman

5.3 Map certain URL to another host

  • Rule: https://proxyman.io/v1/user (for instance)

  • Select Any and Wildcard

  • Un-Check Include all subpaths of this URL: Un-check means it doesn't map other subpaths

Map To:

  • Protocol: https

  • Host: New Host (e.g staging.proxyman.io)

  • Port: 443 (your local port)

  • Leave Path and Query Empty

Result:

Original URL

To URL

https://proxyman.io

https://proxyman.io (does not map the rule)

https://proxyman.io/v2/setting

https://proxyman.io/v2/setting (does not map the rule)

https://proxyman.io/v1/user?id=123&name=proxyman

https://staging.proxyman.io/v1/user?id=123&name=proxyman