Skip to main content

Nov 18, 2019 - 1 minute read - Software Testing Evil Tester

How to Proxy on Localhost

TLDR; Use a proxy against localhost by using your machine name or private ip address from ifconfig (or ipconfig).

One issue we might experience when working with locally installed applications or testing apps running from a local docker container is that they run on localhost, and we might want to proxy them.

Generic methods

Instead of http://localhost:80


  • the machine name e.g. http://machinename:80
  • your private ip address e.g.

There are a range of ip addresses that are private and not accessible from the internet

You can find your machine ipaddress by using ifconfig or ipconfig (if you are on Windows)

Using this ip address is the most generic approach for using a proxy on your local machine and should work regardless of which proxy you are using.

When I want to find the ip address on mac I combine the ifconfig with a grep to make viewing the output easier:

ifconfig | grep "inet "

Charles Proxy

Charles proxy supports the address so you could add the port on the end of that and your traffic should appear in Charles.


Fiddler supports two special case addresses to use instead of localhost

  • http://ipv4.fiddler
  • http://ipv6.fidder

Demo Video

Watch on YouTube

You will need a Github account to comment. Or you can contact me with your comment.

I reserve the right to delete spam comments e.g. if your comment adds no value and its purpose is simply to create a backlink to another site offering training, or courses, etc.