In my test setup, I have:

HTTP Server: localhost:9090
ATS Proxy:   localhost:8080

My /etc/hosts file contains: localhost ubuntu example.com

When I try to access HTTP server (localhost:9090) with out any proxy, it works!

However when I configure the ATS proxy in my browser, and try to access web server, it throws the below error. 

Unknown Host
Description: Unable to locate the server named "localhost (2)" --- the server does not have a DNS entry. Perhaps there is a misspelling in the server name, or the server no longer exists. Double-check the name and try again.

Is there anything missing above? Why do it is trying to point to localhost (2)?

NOTE: When I use the IP address ( there is no issue.