I'm trying to use Charles to map requests for my server to localhost on my Mac. The server is on HTTPS and the local is HTTP. I'm trying that from the Chrome browser, iOS simulator and Postman. it always fails.

I set map remote in charles from to . If I try , charles maps the request but I get error in CONNECT request. If I try , the request succeeds.

EDIT: There is an answer that suggests rewrite instead of map remote. it is good and working, but it feels to me as a workaround. I would like to use map remote as usual. I guess it require both Charles setup and machine setup

3

4 Answers

You should try using the Rewrite function like this:

enter image description here

2

enter image description here

As @kubano suggested, I'm using REWRITE tool with URL rewrite. In order to map all subpaths, I'm using regex group to replace the hostname but re-attach all that comes after '.com'. When wrapping something with () it is referred as 'group' and you can use it with $1 $2 ... and so on. in this case, what ever comes after '.com' is referred as $1 in the replace section

1

I suggest using Map Remote from Proxyman to map between HTTP <-> HTTPS which is easier to setup.

Just create a rule, set HTTPS to HTTP, and the host. It will map from to

Doc:

enter image description here

Disclaimer: I'm the creator of Proxyman and hopefully it would help you.

In case somebody comes here to search for how to map local (file) from an https location (which did not work for me out of the box):

Similar to the rewrite rule (in Charles 4 at least) it works with map remote, mapping https to an http location (e.g localhost) and then mapping that (localhost) url to a file enter image description here

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.