RE: [squid-users] My PreDefined DownLoad

From: Vishal Agarwal <>
Date: Tue, 17 Jul 2012 18:01:44 +0600

-----Original Message-----
From: Eliezer Croitoru []
Sent: Tuesday, July 17, 2012 5:39 PM
To: Vishal Agarwal
Subject: Re: [squid-users] My PreDefined DownLoad

On 7/17/2012 1:59 PM, Vishal Agarwal wrote:
> Dear All,
> Is there any way to replace the download location for some client PC via
> squid.
> Like if somebody is downloading say .torrent file from any location; he
> should end up with my predefined .torrent file located in my localhost web
> server location torrent file.
> Thanks/regards,
> Vishal Agarwal
try to not hijack other people threads to keep the list in order, please.

it can be done but it's preferred to redirect them into some html page
that is saying something about restrictions of the network.
you can use the url_rewrite_program.
i wrote some url_rewriter in these examples:

mine uses regex to find a match.
if so will send a rewritten url to the server.
you can use it like this:
def main
   while request = gets
         request = request.split
      if request[0]
         case request[1]
           when /^http:\/\/.*\.torrent$/
             puts request[0] +
             puts request[0] + ""
         puts ""

STDOUT.sync = true


Eliezer Croitoru
IT consulting for Nonprofit organizations
eliezer <at>
Hi Eliezer,
Thanks for your reply. If I have committed any mistake I apologize for that.
I am really interested in changing the download file; because I can generate
custom error message for some specific type of extensions.
Vishal Agarwal
Received on Tue Jul 17 2012 - 11:59:12 MDT

This archive was generated by hypermail 2.2.0 : Tue Jul 17 2012 - 12:00:02 MDT