Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem making a proxy server" Watch "Problem making a proxy server" New topic
Author

Problem making a proxy server

Muhammad Mubashar Shoaib
Greenhorn

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: http://www.somewebsite.com
-- 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, http://www.url.com
and checkitout/mypage.jsp etc in stream of http://www.somewebsite.com
-- I change these links to:
** http://www.myurl.com/myservlet/http:/www.somewebsite.com/image_1.jpeg
** http://www.myurl.com/myservlet/http:/www.url.com
** http://www.myurl.com/myservlet/http:/www.somewebsite.com/checkitout/mypage.jsp"

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:

--- http://www.the-cloak.com
--- https://proxify.com
--- https://www.megaproxy.com/freesurf/


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."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem making a proxy server
 
Similar Threads
http://www.url.com vs http://url.com
Changing index.html to home.jsp on Tomcat 5
invoking a JSP page
getting images from web
HttpClient redirect