How to force browsers to use proxy server for specific domains such as google.com or facebook.com

I know IE allows you to force all connections through a proxy server, except specific domains or local addresses. But is there a way to let IE to reach Internet directly, and only force connections to specific websites through proxy?

Use case is if google.com or facebook.com are blocked and I want to force connections to these sites through a VPN connection to a proxy server hosted somewhere else, while direct access to Internet for everything else.

7

3 Answers

A generic solution to this problem is to use a custom proxy auto-configuration (PAC) file. In this file you can have arbitrary logic to select the proxy - including a white list of domains.

Here is how to do it:

  • Create a text file anywhere in your local file system, e.g. C:\ProxyAutoConfiguration.js
  • Paste the following content into that file

    function FindProxyForURL(url, host) { // use proxy for specific domains if (shExpMatch(host, "*.google.com|*.facebook.com")) return "PROXY yourproxy:8080"; // by default use no proxy return "DIRECT";
    }
  • Configure the file URL of this file (e.g. file:///C:/ProxyAutoConfiguration.js) as proxy auto-configuration script in your system or browser. In IE, this configuration is here: Internet Options > Connections > LAN settings > Use automatic configuration script.

For more information on the proxy auto-configuration file format, see for example this web page:

5

I think I found a solution. There is a ton of proxy tools for Windows on Codeplex! This way I don't have to setup something like Privoxy, which appears to be a bit overkill and harder to configure.

You can do that using a chrome extension. Download and install Browsec and then in the settings go to smart settings and then turn on proxy for your choice websites. Here you can read in full details. Set Proxy for a specific website domains

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like