W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 1998

Re: Jigsaw proxy

From: Yael Stav <stav@radview.com>
Date: Tue, 13 Jan 1998 13:31:46 +0200
Message-ID: <34BB50A1.E23974C5@radview.com>
To: George Vardaggalos <gvard@telecom.ece.ntua.gr>, jigsaw mailing list <www-jigsaw@w3.org>

George Vardaggalos wrote:

>  Hi Yael.
>  I'm a new user of Jigsaw. I saw you in the mailing list of jigsaw, and
>  also saw you've already used jigsaw as a proxy.
>  I want to make a java client which will request a url from the jigsaw
>  proxy, (that means I'll use jigsaw as a proxy. After the process
>  described in the FAQ for setting jigsaw as a proxy do I need to do
>  anything with the admin and what's this?) and the proxy will fetch it
>  from the desired web server. (of course I'd like to support get and post
>  methods)
>  How could I do it if I wanted to call jigsaw proxy via HTTP so as to
>  download the desired url?  I've made a java process, not so efficient
>  indeed to download urls to my hard disk. But I'd like to use this
>  proxy so as to check before it gets the original web server its cache.
>  Is it easy to be done too? You know, I'm a new java programmer, and I'm a
>  bit confused with all this huge API.
>  Could you give me some simple solutions?
>  that's the code I wrote, how could be done using jigsaw proxy?
> ( I know it's not the best code but I saw url saved in my hard disk)
> import HtmlException.*;
> import java.io.*;
> import java.net.*;
> class getURL {
> public static void main(String[] args) {
>                 try {
>                       URL url = new URL(args[0]);
>                       File f = new File(url.getHost());
>                       URLConnection urlc = url.openConnection();
>  BufferedReader br = new BufferedReader(new
>  InputStreamReader(urlc.getInputStream()));
>                      String inputLine;
> DataOutputStream out = new DataOutputStream(new
> FileOutputStream(url.getHost()));
>                      while (( inputLine = br.readLine()) != null)
>                   for (int i=0;i<inputLine.length();++i)
>                   out.write((byte)inputLine.charAt(i));
>                      out.close();
>                      br.close();
>                 } catch (FileNotFoundException e) {
>                     System.err.println("FileStreamsTest: " + e);
>                 } catch (IOException e) {
>                     System.err.println("FileStreamsTest: " + e);
>                 }
>             }
> }
>  Thanks in advance,
>  George.

I can answer some of your questions, since I'm indeed using
Jigsaw as a proxy server (though I'm using it with no caching functionality):

a. After you install Jigsaw as a proxy, as described in the FAQ,
you should be able to check whether it's working or not.
Just use any web browser, configured to use the proxy, and see if you get all
the web documents alright.
4 example: In Netscape Communicator go to Edit/Preferences/Advanced/Proxies
and choose in the manual proxy configuration, as the HTTP proxy, the host (and
port)  where you installed jigsaw.

b. If phase a went OK, this means the Jigsaw is indeed working.
    Now all you have to find out is how (if possible) you get the
URLConnection to address Jigsaw as a proxy, instead of sending the HTTP
request directly to the destiny web server.
I can't help you with this, but I think that if it doesn't appear in the
URLConnection API you should probably write some new class extending it, which
will set the appropriate headers in the HTTP request.

Hope this helps,
Good luck.

Yael Stav               Email: stav@radview.com
Radview Software Ltd.   Voice: (972) 3-765-0522
http://www.radview.com  Fax:   (972) 3-647-1406
Received on Tuesday, 13 January 1998 06:33:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:41:23 UTC