TL;DR:
- Open command line (
C:\Windows\System32\cmd.exe) and type this command in the console window:
"C:\TorBrowserBundle\Browser\TorBrowser\Tor\tor.exe" --HTTPTunnelPort 8118. Adjust path according to where your Tor Browser Bundle is located.
- In Charles go to menu
Proxy→External Proxy Settings
- Select
Use external proxy servers checkbox at the top
- Clear
Web Proxy (HTTP) and SOCKS Proxy checkboxes on the left side
- Select
Secure Web Proxy (HTTPS) on the left side
- On the right side under
Secure Web Proxy Server enter 127.0.0.1 and 8118
- At the bottom select
Always bypass external proxies for localhost checkbox
- Click
OK to save changes
- Try opening https://google.com/ in the web browser configured to use Charles (better in Incognito window to make sure that your Google account settings do not interfere with Google language detection by geo-location). You should see localized Google page in some random language.
Explanations
Tor provides SOCKS proxy out of the box. By default Tor uses port 9050. You mentioned port 9150. This is default port used by Tor Browser Bundle. So I assume you use Tor Browser Bundle. But specifying SOCKS Proxy settings in External Proxy Settings in Charles won't allow you to open websites via https:// links. If you take a look at the Charles documentation, you might notice that only non-HTTPS traffic is being sent via SOCKS proxy. Quote (emphasis mine):
If you have a SOCKS proxy Charles will use it for all non-HTTP(S) traffic such as for Port Forwarding.
So in order to chain Charles via Tor, you must use non-SOCKS proxy.
By the way, I was unable to open http:// links via Charles when specified Tor as SOCKS proxy and disabled Secure Web Proxy (HTTPS). No idea why.