[squid-users] url_rewrite_program in Java

From: Lu, Roy <rlu_at_FACorelogic.com>
Date: Thu, 14 Jan 2010 15:00:35 -0800

Does anyone have an example of a url rewrite program in Java. I tried
with the following code but it did not work.

----------------------------
Squid.conf:
url_rewrite_program /usr/bin/java -classpath /usr/local/squid/sbin
RewriteHelper
----------------------------
RewriteHelper.java:

import java.io.*;

public class RewriteHelper {

    public static void main(String[] args) throws Throwable {
        try {
            BufferedReader in = new BufferedReader(new
InputStreamReader(System.in));
            String input;

            while(true) {
                input = in.readLine();
                System.out.println(input);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
----------------------------
It seems that Squid only regards 'java' as the rewrite program, not the
entire command with the java class, i.e., '/usr/bin/java -classpath
/usr/local/squid/sbin RewriteHelper'.

Thanks.
Roy

******************************************************************************************
This message may contain confidential or proprietary information intended only for the use of the
addressee(s) named above or may contain information that is legally privileged. If you are
not the intended addressee, or the person responsible for delivering it to the intended addressee,
you are hereby notified that reading, disseminating, distributing or copying this message is strictly
prohibited. If you have received this message by mistake, please immediately notify us by
replying to the message and delete the original message and any copies immediately thereafter.

Thank you.
******************************************************************************************
FACLD
Received on Thu Jan 14 2010 - 23:00:41 MST

This archive was generated by hypermail 2.2.0 : Fri Jan 15 2010 - 12:00:02 MST