SourceForge.net Logo
Download

HttpTea - A HTTP / HTTPS Protocol Logger

What is this Program doing?

HTTP (Hyper Text Transfer Protocol) is an ASCII protocol used to transfer data between a your browser and the WEB servers (the other site of the internet).

NEW The program is now able to decode and display encrypted HTTPS data.

This program allows you to:

  • Watch this exchange of data.
  • Change the protocol data.

Why do I need this Program?

This program is made everyone who is constructing and debugging WEB applications. However, if your application consists only of a number of HTML pages, you will not need this program. If your are doing more complex dynamic WEB application using PHP or J2EE, you'll know about problems like:
  • Cookies are not send to your server
  • A session is lost
  • Request parameters are not passed to your application
  • HTTP-Redirects do not work as expected
HttpTea can help you to track down this kind of problems.
I'm working with complex WEB application since some years and during this time I've learned HttpTea all that I ever needed to see or alter in the HTTP protocol. This may or may not fit your needs. If it does not - feel free to improve the program!

How do I Start this Program?

First of all, you need a Java runtime environment. The following Java versions are supported:
  • Java*1.4
  • Java*1.5
Make sure that you have the correct version of Java installed by using:
java -version
To start the program use:
java -jar HttpTea.jar [options]+
First of all, you should view the help texts of the program. Use:
java -jar HttpTea.jar -? 1
To get informations about the different options use:
java -jar HttpTea.jar -? <option>
Example:
java -jar HttpTea.jar -? l
The most important option is the "-l" option. With this option, you specify on which port the program is listening.

How this the Program Working?

The program sits between the client (your WEB browser) and the server much like a proxy. What ever the browser of the server are sending, is displayed on the console.

Configurations

Simple Configuration

On the client site HttpTea is wired in between the client browser and the server like a proxy server.

..............................                    
.    local PC                .         +------+   
. +-------+        +-------+ :    /--->|Server|   
. |Browser|------>o|HttpTea|-----/     +------+   
. +-------+       ^+-------+ :                    
.                 |          .                    
.                 |          .                    
.             Listener Port  .                    
..............................                    
Required settings:
  1. Browser: set the proxy server to localhost:Listener-Port
  2. HttpTea -l Listener-Port
Example: java -jar HttpTea.jar -l 9000

Configuration with Proxy Server

On the client site HttpTea is wired in between the client browser and the proxy server.

..............................                                    
.    local PC                .         +------+                    
. +-------+        +-------+ :    /-->o|Proxy-|-\    +----------+
. |Browser|------>o|HttpTea|-----/    ^| Host |  \--o|App.Server|
. +-------+       ^+-------+ :        |+------+      +----------+ 
.                 |          .        |                           
.                 |          .   Proxy-Port                       
.             Listener Port  .                                    
..............................                    
Required settings:
  1. Browser: set the proxy server to localhost:Listener-Port
  2. HttpTea
    • -l Listener-Port
    • -p Proxy-Host:Proxy-Port

Configuration Example 1

HttpTea -l 9001
        -p 138.222.190.40:1001 
        -x "138.221.*;www.heute.de"
HttpTea will listen at port 9001 and send all requests to the proxy server 138.222.190.40:1001. Requests for IP addresses beginning with 138.221. are not send to the proxy server but directly to their target. The same is true for any requests for the host www.heute.de

Configuration Example 2

HttpTea -l 9001 
        -h www.heute.de=138.222.190.1 
        -h www.yahoo.com=138.222.190.1 
        -h www.yahoo.com:8080=www.google.com:80 
HttpTea will listen a port 9001. All requests for the hosts www.heute.de and www.yahoo.com will be deferred to 138.222.190.1. Any request for host www.yahoo.com on port 8080 will be deferred to www.google.com on port 80.

Configuration Example 3

HttpTea -l 9001 
        -H www.heute.de=138.222.190.1 
        -H www.yahoo.com=138.222.190.1 
HttpTea will listen a port 9001. Any HTTP Redirect that the server sends to the client browser which point to a location on the hosts www.heute.de or www.yahoo.com will be modified to point to the host 138.222.190.1 instead. HttpTea will change the content of the LOCATION attribute in the HTTP header.

Program Options

General Options:
	-? [1..n]	Display help.
	-? [a..z]	Display information about an options.
	+/-i		Toggle display of HttpTea configuration.
	-l port 	Listener port.
	+/-n 		Toggle display of thread number.
	-p host[:port] 	Proxy host and port.
	-r		Raw Mode. The HTTP protocoll is not analyzed.
	-s 0..n		Client socket timeout.
	-S 0..n		Server socket timeout in ms.
	-v 0..5		Verbose level. 0=none;1=error;2=warning;3=info;>3=debug
	-y 0..n		Buffer size.
HTTP Options:
	-a ;attribute		Attribute deleted from request
	+a ;attribute:value	Attribute added to request
	-A ;attribute		Attribute deleted from response
	+A ;attribute:value	Attribute added to response
	-b 			Disable display of the HTTP content.
	+b [Format]		Enable display of the HTTP content.
	-c 	Change cookies in COOKIE (HTTP request).
	-C 	Change cookies in SET-COOKIE (HTTP response).
	-d host			Host excluded from the output.
	+d host			Host included in the output.
	-e host=IP-Adr		Overwrite default hostname resolution.
	-h host_org=host_new	Host replacement in requests.
	-H host_org=host_new	Host replacement in response.
	-R ;200..505	Alter the HTTP result for given URL.
	+/-t			Toggle display of the raw HTTP header.
	+/-T			Toggle display of the processed HTTP header.
	-x host			Dont send via proxy.
HTTPS Options:
	-g [port]		Decode HTTPS traffic.
	-k path;password	Path to and password of the truststore file.
	-K path;password	Path to and password of the keystore file.