Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Firefox is add-on FoxyProxy, which makes possible use many proxy with filtering URLs. I need it for any browser, but in many of them it is only possible to set one proxy server. I need a transparent local proxy, which may filters URLs and forwards traffic to other proxies. I've heard about Squid, but I haven't found information about it. It is possible to set it in Linux (and how)?

share|improve this question
up vote 1 down vote accepted

Most browsers that support Javascript also support Netscape-style proxy autoconfiguration (PAC) files (I'm not aware of a JavaScript-capable browser released this century that doesn't). PAC files contain JavaScript code that is executed to determine what proxy (if any) to use for each request.

function FindProxyForURL(url, host) {
    if (shExpMatch(host, "*.example.com")) {
        return "DIRECT";
    } else if (shExpMatch(host, "somewhere.else")) {
        return "PROXY someproxy:8080";
    } else {
        return "PROXY default-proxy.example.com:3128";

To have a single setting for browsers and other applications that don't support Javascript, you'll need a proxy that supports per-URL parent proxies.

Squid is one possibility, it's a caching proxy designed for high loads and with many features. See Squid selects parent depending on requested URL? for examples of how to set up per-URL parent proxies.

Wwwoffle is another possibility. This proxy is strongly oriented towards having an offline cache, and caches more aggressively than is allowed by the HTTP standards, which is a problem with some sites. Parent proxies can be specified per-URL with wildcard patterns (the default configuration files contains commented-out examples).

share|improve this answer

The answer here is going to be to set your single value to a proxy server of your own so that all traffic hits it. This can be a system wide setting.

As for setting up your own proxy server, yes squid is the best option I know of and yes it can be setup and run on a Linux machine. It is best run on a gateway/router machine, but you can run it on your personal machine for use locally as well. There are lots of guides available for how to configure it. They cover a wide range of possible uses, you should search specifically for whatever kind of configuration you want to accomplish.

share|improve this answer
It isn't answer. I'm looking for a possibility using many proxies not one. About first part your answer I've heard, but it is for one proxy. I've written: "I've heard about Squid, but I haven't found information about it". I've meant that I haven't found information about option, which makes possible to set many proxies (for example: for google.pl run first_proxy.com, for other sites run second_proxy.com). – godlark Aug 1 '11 at 16:32
@godlark: The point is that to use many proxies from some program that only supports using one, you need to setup ONE proxy that can then itself connect to as many others based on whatever rules you need. – Caleb Aug 1 '11 at 16:33
Yes I know :) But I search information about proxy serwer with these possibilities. Thanks for answer. – godlark Aug 1 '11 at 16:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.