Kev's Development Toolbox
Development Utils:

Back

Http Request Viewer
Overview
Listens on a socket for incoming Http requests and displays the received Http Request Headers

Jar File httpdisplay.jar
Source jar httpdisplay_src.jar
Javadoc docs.jar


Description

This app is useful for inspecting the headers being sent from a device (eg mobile/wireless device) or any other browser.

This is useful if you are developing an app to

  • handle multiple devices and are interested in the 'User-Agent' header (to determine the browser type and capabilities running on the client device in order to send back device specific content)
  • intercept the 'Accept-Language' header to send back specific language content
Running the app

Run the app from the jar:

java -jar httpdisplay.jar [portnumber]

- where [portnumber] is the port you want the tool to listen on for requests (eg 80, or 8080), eg

java -jar httpdisplay.jar 80


Interesting Features
  • Illustrates simple use of java.net.Socket and java.net.ServerSocket


Limitations

The app currently does not return an HTTP response back to the calling app, so eventually the caller will time out. The request is still displayed in the app (see screenshot below)

Screenshots:

1. Main application window

Site designed and
developed by
MindBeans Software Consulting: Independent Consultants - Software Design and Development
© Copyright Kevin Hooke, MindBeans Software Consulting 2002-2008.
All Rights Reserved.
Running on JBoss4.2.0/Tomcat5.0, Linux Fedora Core FC4 2.6.11
Current uptime last checked at: Fri May 23 22:08:39 PDT 2008
22:08:39 up 19 min, 2 users, load average: 0.02, 0.22, 0.28
  Last updated: Oct 2007 v2.0