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 my-server.com/*
to http://localhost:PORT
.
If I try https://my-server.com/
, charles maps the request but I get error in CONNECT request.
If I try http://my-server.com
, 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
You should try using the Rewrite function like this:
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
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 https://your-server.com to http://localhost:3000
Doc: https://docs.proxyman.io/advanced-features/map-remote
Disclaimer: I'm the creator of Proxyman and hopefully it would help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With