Proxy "http://127.0.0.1" through Proxy Server in Edge, IE11 or IE10

1

For some reason, I can push any domain through my internal proxy server, besides http://127.0.0.1 or http://localhost. Any other domain is proxied correctly. Making sure that "bypass proxy server for local domains" is unchecked doesn't really help.

Here are my proxy settings in Edge:

enter image description here

Reasoning: As many people may wonder why on earth would I like to do that: I have a bunch of modern.ie virtual machines for various versions of IE/Edge to test my projects on. Setting up a proxy like that would very easily allow me to test my local projects on these VMs without the need to hassle with creating host-only adapters and/or bridging the network and then trying to bind various applications to that interface (and re-configuring them to not use 127.0.0.1 in http redirects).

samu

Posted 2017-12-12T09:32:36.607

Reputation: 81

Have you tried using Hosts file redirection? On which machine are you running the WebApplication? If on base can't you access the it from the VMs using hostname of basemachine? – AEonAX – 2017-12-12T09:41:59.753

I can, but what is important is that all of my apps I'm working on (10+) require the host to be 127.0.0.1. And that, unfortunatelly, cannot be done by using hosts file redirection. That would require re-configuring every single app to use 'localhost', or some other domain instead, which is just too much work for every developer in my team (they will be using that same solution as well). – samu – 2017-12-12T09:43:04.027

Changing 127.0.0.1 to localhost or some other name will one time activity IMHO. – AEonAX – 2017-12-12T10:14:08.343

Actually, it's not that simple. In order for this to work it would need to be changed to a separate domain name. That domains would need to be configured in every developers /etc/hosts file locally, AND on each VM hosts file. In VM though it would have to point to a host-only network internal IP (virtualbox terms) of the host. That means that in order for this to work each developer has to re-configure every web-service + its host OS + every VM OS.

With proxy, that's only a simple proxy configuration for every VM. Provided that it was working, of course... – samu – 2017-12-12T10:17:12.447

Are these web apps intentionally made to listen only on 127.0.0.1 i.e not accessible from outside the hosting machine? – AEonAX – 2017-12-12T10:21:07.373

They're not. It is possible, it's just that configuring a proxy server is much more simple for new developers that are joining the team. FYI - I already have a PoC working with additional domain, and binding to a bridged or host-only adapter. I'm just working on improving that, and reducing the amount of configuration needed. This works very well in VMs with chrome or ff, which maintain proxy on their own on linux. If only it worked on IE, it would be the perfect solution. – samu – 2017-12-12T10:33:41.137

Can you clarify my following doubts? 1. Web Apps are hosted on base machines. 2. They can accept connections from remote machines. 3.Remote Machine can use base machine's hostname to access webapps. 4.What type of network adapter is used the VMs? Remote machines in this case are VMs – AEonAX – 2017-12-12T10:42:00.523

>

  • Correct ;
  • Partially correct, they can be re-configured to do so, but it's cumbersome ; 3. Correct ; 4. NAT. FY - I know I can solve it by just exposing my apps to a different adapter. I already have this working. I want to improve that by using proxy. I have a tested and working workaround solution, so let's not get away from the main point of this question, which is how to force IE/Edge to push 127.0.0.1 through a proxy server.
  • < – samu – 2017-12-12T12:13:33.827

    Is this applicable to you http://egalo.com/2012/05/29/testing-mac-web-site-using-local-hostname-on-mobile-device/ ? tl;dr: Run Proxy on webserver, Modify Hosts file on webserver, Use that proxy in all browsers

    – AEonAX – 2017-12-13T05:23:30.753

    Answers

    2

    So, apparently, it's not possible. 127.0.0.1, ::1 and localhost is hardcoded not to go through a proxy.

    What I went with instead is localhost., with a dot at the end. This has a few advantages over any other solution:

    • Every OS I use (Windows, Linux and OS X) translates this to 127.0.0.1, so I can just configure my front-end apps to "think" that my api is at "localhost.". Then I can use my apps like nothing changed, and it will still work (backend apps don't require much configuration, angular5 needs to be run with --disable-host-check, but that's pretty much it.
    • Windows doesn't threat localhost. like it's something special, and just pushes it through the proxy.

    So, I can use 127.0.0.1 or localhost on basically all machines, and it just works. I just have to remember to use localhost. on IE VMs, but I guess I'll just have to live with that.

    samu

    Posted 2017-12-12T09:32:36.607

    Reputation: 81