Chas
Chas

Reputation: 51

Charles Proxy not capturing localhost traffic when using Safari on MAC

When using Safari on MAC, Charles proxy is not capturing the localhost traffic.

Using Opera, Chrome and Firefox all works as expected and captures all the localhost traffic.

I have researched this issue extensively but to no avail. I have tried using ...

http://localhost.charlesproxy.com, local ip address, machine name etc and several other suggestions but nothing seems to work

Upvotes: 5

Views: 6092

Answers (1)

avernet
avernet

Reputation: 31753

The following worked for me with Safari 12.0 in Mojave:

  1. In Charles, in the Recording Settings, under Include, I added http://localhost.:8080/. Note the . (dot) after localhost, and of course replace 8080 with whatever port matters to you.
  2. In Safari, I used the http://localhost.:8080/ to connect to my app running locally.

It seems that by default either Safari or a library that Safari uses doesn't use the proxy for localhost. I would prefer to find a way to setup Safari or macOS so localhost wasn't excluded, but haven't found one.

Also see Localhost traffic doesn't appear in Charles from the Charles FAQ.

Upvotes: 7

Related Questions