Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What application should I use as a proxy to route either to another proxy or send the request direct through based on the logic described in the function below?
(Can't find a more accurate way to describe it)
ProxyFunction(url)
{
if(url == *.jpg OR url == *.xml OR url == *.css)
return DIRECT
if(url == one.domainA.com OR url == two.domainB.com)
return DIRECT
if(url == domainA.com OR url == domanB.com)
return OTHER_PROXY
Return DIRECT
}
I plan to use it on my Synology NAS, so I'd prefer one of the applications available with ipkg, but I can download and compile (wget, configure, make, make install) myself if it is needed.
Not a networking question. Moved to Linux - Software.
Your pseudo code is confusing, as this *looks* like a proxy.pac file. if this IS meant to be browser config then that's all possible with proxy.pac files certainly. If this is to perform some sort of service on a remote box, I'd say that mod_proxy on apache can do all of this, or nginx.
Note that you'd want to use ProxyPreserveHost on the apache config so that when you send the traffic to a different proxy device, the original hostname will be there, not the hostname if the upstream proxy you specificy (or at least, that's likely to be what you want if I do understand your requirements)
EDIT _ and you can of course do this with a full web proxy, i.e. squid http://wiki.squid-cache.org/SquidFaq/SquidAcl with acls and cache_peer directives. Not sure how I managed to NOT mention squid...
Last edited by acid_kewpie; 01-24-2013 at 03:27 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.