36
8
I have a number of staging and test servers that I need to constantly modify my hosts file to access (they depend on the domain name, so I have to change the hosts file to get them to work).
I find this annoying. I'd like to setup a portable browser of some kind for each kind of site I want to work with. Is there any version of any graphical web browser (including browsers based on the rendering engines of other browsers) that will do this?
This way I can simply launch the instance that's already configured to work with staging if I want to test staging.
Any ideas?
EDIT: The important feature is the ability to run two browsers concurently, both browsing to some-address.com
, but with one browser directing the reqests to the server at 1.2.3.4
and the other browser directing the requests to the server at 5.6.7.8
.
EDIT: (3/16/14)
This question was asked several years ago, and I still don't know of a decent way to do this. Let me try to explain further, because people seem to misunderstand the problem. It's not something that can be easily fixed just by using a proxy server. I suppose it might be possible to write extensive rules in a proxy server to solve the problems, but that's a huge complex solution to what should be a simple problem.
So to clarify:
There are three web servers. Production, Test, and Development. Each runs a multi-tenant application that customizes itself based on the hostname used to access it. Conceptually, this is similar to a Content Management System or blog engine that allows multiple sites to be run off the same server instance. You just point the hostname to the server, and whichever hostname is used to access it via HTTP 1.1 hostname mapping, is the site it displays.
Any solution which simply rewrites the host file doesn't work because of the requirement to run multiple browser windows at the same time to the different sites, production, development, test, etc... So simply constantly altering the host file doesn't work because it affects all browser instances. If you change the mapping for one browser, then the other browsers are also now mapped to that server so any subsequent requests will go to the wrong server.
All i'm looking for is a way to force this browser instance to use this host file, and that browser instance to use that host file, such as through a command line parameter. I don't even care if I need to install multiple copies of the browser.
This may be doable with firefox portable, since I think it uses its own config files per installed copy, but the problem is that the third party software used to administer the sites does not work with firefox (the sites themselves do, but the admin tools do not, they work fine with chrome and IE and Opera, however.. and I have no access to the source for this to fix it).
Most people in your situation run a couple of WinXP or Ubuntu virtual machines with different HOSTS configs. – digitxp – 2010-12-13T23:14:40.203
@digitxp - Yes, I'd already thought of that but i really don't want the overhead of multiple VM's and several entire OS's just to browse a couple of sites. Obviously, if there is no other choice that's what i'll probably have to do.. – Erik Funkenbusch – 2010-12-13T23:18:33.603
If all else fails: Fiddler Web Debugger (Windows) or GlimmerBlocker and Charles Web Debugging Proxy (Mac) can rewrite the requests on the fly...
– Arjan – 2010-12-13T23:30:11.873@Arjan - Proxies will work to some extent, but I would have to have a seperate proxy instance for each browser instance, or change proxy settings each time which is even more annoying that changing host files. – Erik Funkenbusch – 2010-12-13T23:45:35.807
No, you could then use different domain names in your browsers, and rewrite those names using the proxy. (But I know: it's not what you asked for.) – Arjan – 2010-12-13T23:47:46.237
You want (effectively) a separate hosts file "for each kind of site you want to work with" What does the bit I put in quotes mean? – barlop – 2010-12-15T11:06:49.520
1Perhaps a Web Proxy like squid, would let you redirect in a way that does what you want done from DNS resolution? (of course a web proxy can be configured on a per browser basis) – barlop – 2010-12-15T11:15:50.883
this really needs to be a firefox plugin... would be a nice one! – boomhauer – 2012-05-12T17:04:11.047
It looks to me that you need a browser with its own IP stack. – dotancohen – 2012-11-18T16:03:34.393
If setting up a proxy server that does some rewriting would be feasible, then see Easy way to view a website at a different IP than associated with hostname? (cc. @noloader)
– Arjan – 2014-03-16T08:18:44.593looking at some of your comments you seem to conflate the concept of a separate proxy for different -instances- of a browser, with the concept of a different proxy for different browsers(where all instances of any one browser might or would use the same proxy). The word "instance" has a specific meaning. – barlop – 2014-03-16T16:09:44.387
@barlop - It's not possible to use a different proxy for different instances of IE. What i'm trying to accomplish is to be able to launch different instances of the browser using a different host/ip mapping. – Erik Funkenbusch – 2014-03-16T20:51:26.873
@ErikFunkenbusch I vaguely recall that firefox has an extension called FoxyProxy that lets you say this site can use this ip. That's quite far from what you're asking, I don't know if that helps. Also it may be worth considering proxifiers and transparent proxies, tsocks is an example it's mentioned here http://kakku.wordpress.com/2007/11/18/proxify-any-application-tsocks-and-proxychains-force-any-program-to-communicate-through-a-socks-https-proxy-or-use-cascading-proxies/ and http://superuser.com/questions/319516/how-to-force-any-program-to-use-socks
– barlop – 2014-03-16T23:51:24.200@ErikFunkenbusch with firefox maybe if each ff instance is launching in its own profile then it could have its own proxy settings or its own foxyproxy settings even. I notice though that for any of those suggestions, you're not getting a separate hosts file. though harrymc's sandboxie suggestion sounds like it may work. – barlop – 2014-03-16T23:52:41.910
@barlop - I already mentioned that I thought a portable ff could have its own settings for each installed copy. But as I also said, the software doesn't work with FF. So neither would foxyproxy, but they're good choices for others. – Erik Funkenbusch – 2014-03-17T06:17:11.950
@ErikFunkenbusch You say 3rd party programs won't work with FF.. so you think foxyproxy wouldn't work with FF. That is confusion on your part. IE,Chrome, and Opera(now though perhaps not in the past), use the windows proxy settings, while firefox uses its own one. So programs that work by changing the windows ones, won't affect firefox. But FoxyProxy does not change windows settings, it/and it is a firefox extension. FoxyProxy is not for Chrome and IE, it is for Firefox! whether it helps you or not is another matter. And >1 solution w/ FF is better than just 1 w/FF. – barlop – 2014-03-17T10:19:11.590
@ErikFunkenbusch furthermore, do you have any comment on dave parrish's solution of multiple squids, each with its own hosts file, and chrome launched with a command line to give it its own squid web proxy and you specify on the command line, the squid web proxy that has the hosts file you want for that instance of chrome. Furthermore, on the subject of proxifiers and transparent proxies, they wouldn't and couldn't work by changing those windows proxy settings that chrome and IE use. They are designed to also work with software that has no proxy set. – barlop – 2014-03-17T18:17:48.220