Apache TCP Monitor - How To?
Monitoring messages that exchanged between a client and a server is necessary specially when it comes to Web service debugging. The decoupled nature of the situation makes it a tedious (or even impossible) task to debug the actual programming code in finding the bug. The captured messages, however, can assist to achieve this as they provide the insight into the actually transferred content.
Apache TCPMon is a tool that lets you monitor messages. At present it comes in three flavors; the standalone .jar distribution, the IntelliJIDEA plug-in, and the Eclipse plug-in (which, of course was written by me :)). All three have the same interface except for the IDEA plug-in, which lacks the sender capability (this I will explain shortly).
To get started with first download any of the flavors you like from the following locations.
1. Standalone: http://ws.apache.org/commons/tcpmon/download.cgi
2. Eclipse plug-in: http://dist.wso2.org/maven2/tcpmonitor/tcpmonitor/1.0.0/tcpmonitor-1.0.0.jar
3. IDEA plug-in: Just go to File --> Settings --> Plugins --> Available tab, then right click on Axis TCPMon and click on “Download and install”.
To start TCPMon do the followings.
1. Standalone: Extract the binary distribution zip file and run the tcpmon.bat (if in MS-Windows) or tcpmon.sh (if in any Linux based OS). These scripts are found inside the build directory of the extracted folder.
2. Eclipse plug-in: place the downloaded .jar file into the plugins folder under Eclipse root. Then in Eclipse editor go to Window --> Show View --> Other --> Axis TCP Monitor.
3. IDEA plug-in: Window --> Tool Window --> TCP Mon.
The following figure shows the interface that you can see when TCPMon is started.


The listen port means a port number in your machine. This will be the port number which will be monitored by the TCPMon.
The Listner and Proxy modes allows you to control the behavior of the TCPMon once a message is received. The Listener mode means to send any incoming message to the given hostname:port and at the same time it will show you the message sent out (which of course is the message received by the TCPMon from the listen port) and the message which comes as the response.
The Proxy mode lets the TCPMon act as a normal proxy meaning that any incoming message to the listen port will be shown and sent to the desired destination. The response will be shown as well.
The http proxy support is needed if your network is backed by an HTTP proxy. Then any message which requires to go out from your machine will require to be sent to that proxy. The proxy host and port are the IP address of the HTTP proxy and its running port.
The simulate slow connection option is very much useful when you want to test your Web service under a slow connection. The message is sent out of the TCPMon in delays specified by the delay in millisecond value. The number of bytes to be sent out each time is given from the bytes per pause value.
After setting the desired options click on Add button to add a new listener/proxy. You can add more than one listener/proxy using TCPMon. Once added the particular listener/proxy will be shown as new tab. The following figure shows an instance of monitoring messages using listener in TCPMon.

Now let us move on to the sender facility provided by TCPMon. The following figure shows the interface of the sender.


The sender allows you to manually send a message to a server. The connection endpoint is the place where you want to send the message to. An example would be a Web service end point reference like http://localhost:8080/axis2/services/EchoService. The SOAP action field is optional and it lets you provide the desired SOAP action. Then you can type/paste the request message to the top text pane and press send. The response message will be shown in the bottom text pane.
| Attachment | Size |
|---|---|
| Screenshot-1.png | 28.43 KB |
| Screenshot-2.png | 25.47 KB |
| Screenshot-4.png | 18.94 KB |
- saliya's blog
- Login or register to post comments
- Printer friendly version
- 2257 reads











And there is another tool,
And there is another tool, actually it is a plugin for Mozilla Firefox called livehttpheaders. If you just want to catch the packets and you really hate programming this would be the best solution. I have used only the Firefox plugin. There may be some other flavours also :)
_______________________
Submited by : Libros Gratis