aspose file tools
The moose likes Tomcat and the fly likes Problem making a proxy server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem making a proxy server" Watch "Problem making a proxy server" New topic

Problem making a proxy server

Muhammad Mubashar Shoaib

Joined: Mar 27, 2005
Posts: 1
hi there,

I am a java/jsp/servlet programmer, trying to write something which you might call a
WebTracker or WebMonitor.

My problem is:
"I want to create a kind of a web proxy so that
EACH url requested by a user passes through my
web application, and that I am able to save that
url somewhere."

What I have done is:
"I provide my users with a textbox in my jsp page, and
allow him/her to write a url and press "SUBMIT".Then I request that
url on the user's behalf just like a proxy server. Meanwhile, I parse
the HTML and JAVASCRIPT of the requested page and insert the url
of my webapp at the beginning. The example explains:

-- user requested:
-- The request comes to my servlet, and I use an HTMLClient library to
request the url.
-- HTMLClient provides me with the HTML/Javascript/Text (whatever) stream
of the requested url.
-- Let us suppose there were links like /image_1.jpeg,
and checkitout/mypage.jsp etc in stream of
-- I change these links to:

Doing so doesn't cover all the cases. For example I can't
post data for the users and there are other problems of the like.
The web is SO heterogenous.
I think you have got the problem.

What my doubt is:
"There are so many anonymous proxy servers on the web which are completely
web-based and allow almost any kind of activity like submitting web-forms, images retreival
and all kinds of stuff. Check out the following:


I doubt there must be some kind of configuration possible in Apache Tomcat (which is my
web-server) which will allow me to track my users. I don't think that anonymous proxy
servers parse and alter HTML streams. There must be something which I don't know."

do you have a solution of any kind.. any ideas? Please help
Thanx in advance

"Sharing your knowledge will add more to it, hiding it won't."
It is sorta covered in the JavaRanch Style Guide.
subject: Problem making a proxy server