W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 1999

how do I proxy everything except for one URL

From: rob sanders <rsanders@draper.com>
Date: Thu, 13 May 1999 16:51:01 -0400 (EDT)
Message-ID: <373B3B15.77F8F3B@draper.com>
To: "www-jigsaw@w3.org" <www-jigsaw@w3.org>

What I'd like to do is proxy everything but hits to a local servlet's

I've got my jigsaw proxy customized to wrap requested URLs into an
HTTP GET and forward them to a servlet running in a second jigsaw
server. This seems to work.

Here's how: I instantiate a new lookupState object inside my modified
ProxyFrame class and rewrite the URL in the request before processing
it. Specifically, I embed the desired URL as a parameter and replace the
requested URL with the URL for the servlet on the second server. I'm
assuming that the old lookupState data structure will just be garbage
collected. (?)

The servlet on the remote jigsaw werver then processes the request and
sends stuff back to the modified ProxyFrame thread in my first server.
It returns the retrieved data to the client browser. 

So far this seems to be working with no serious side effects or
noticeable latency. 

Now for the second step. 

I'd like to be able to bypass proxying for certain resources on the
proxy server rather than routing literally every request through my
modified ProxyFrame class which throws the request over the transom to
the remote machine with my hardwired redirection to the second server.

Specifically, I'd like to have a couple of servlets running on the proxy
configured server. 

I created a servlet subdirectory on the proxy machine:

I wrote a test servlet, compiled it and placed the class file into the
servlet directory. I have done this before a few times with a regular,
non proxy-configured jigsaw server so I'm sure I'm installing the
servlet class correctly.

Then I run the jigAdm client for the proxy server. It already had a
servlet directoryResource. I follow the directions for adding a servlet.

1) click on the http-server puzzle piece icon. Details about the Root
Docs space appear

2) I double click on the servlet folder icon. An "Edit Resource" window
pops up.

3) I add a servlet-Directory frame. I think I also deleted an http
frame  as described in the servlet tutorial. I left all of the inputs
set to their default values.  (THIS MAY BE WHERE I"VE MADE A MISTAKE???)

4) I go back to the servlet resource and set it's put-indexer parameter
to servlet-indexer.

I commit the changes in each window, and carefully exit each by using
close resource window. Then I save the configuration using the floppy
disk icon.

Then I close the window. The changes reappear when I reopen the gui, so
they are being retained.

5) I control c in the window my servers are running in and shut down the
servers. Then I restart them.

6) browser is proxied to the proxy server.

7) I open up a page. usually ABC news. Comes up fine. Remember- in my
case, I'm trapping the request, rewriting the URL, sending it to my
second server, retrieving the request and transmitting it back to my
modified ProxyFrame.

8) now I try my "servlet tunnel" throw the proxy.

By the way, I'm checking for the servlet URL in my modified ProxyFrame.
I don't want to proxy this one URL. So I don't rewrite the URL. I don't
create a new lookUpState class. And I set the request to no proxying- if
the incoming lookpuState's requestURL is the correct URL for my servlet,
I set request.setProxy to false. I thought that would enable my servlet
tunnel. It didn't.

Any suggestions? Where have I erred?


Received on Thursday, 13 May 1999 17:43:34 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:34 UTC