This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Proxy Servlet/Web Browser monitor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Proxy Servlet/Web Browser monitor" Watch "Proxy Servlet/Web Browser monitor" New topic

Proxy Servlet/Web Browser monitor

Viktor Kubinec
Ranch Hand

Joined: Jan 28, 2012
Posts: 34

I want to implement web browser monitor in java (to track all the communication between browser and web application). I started with simple proxy servlet, but I realized that ajax calls are not going through the proxy. Is there some way how to catch also ajax calls? Is there some way how java can hook into the browser communication other than proxy?

Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2716

What is the proxy servlet? Does the browser use it to connect to the proxy? If yes, then the AJAX must pass through the proxy because there is no other way for the browser to connect to the internet/ outside world.
You need to make sure if the browser settings are correct and it is not connected directly to the internet.

|Asking Good Questions|
Viktor Kubinec
Ranch Hand

Joined: Jan 28, 2012
Posts: 34
Proxy servlet is just a simple servlet I deployed to tomcat ROOT, which just forwards the requests and send responses back. Since the requests and responses available here they can be traced or even modified.

I have set up proxy server in firefox in network setting, I checked the option - use for all protocols. But after I shuted down the proxy servlet the page was still updated in the browser by regular ajax calls. So it look like that ajax is bypassing the proxy server.

Maybe I can try to disable firefox to access internet in firewall settings and see what happens then.
jQuery in Action, 2nd edition
subject: Proxy Servlet/Web Browser monitor
Similar Threads
How to make XmlHttpRequest calls to another server
browser to java application communication
Ajax in Front Servlet
Progress GIF Just Displays but No Animation
java swing client setting header