Engineering Full Stack Apps with Java and JavaScript
Looks like TCPMon is not more supported by apache as I can see this message on its home page @ http://ws.apache.org/tcpmon: This project is no longer supported. Any information may be inaccurate or incomplete. Old archived releases are available from here. However we will see tcpmon here quickly as it is very easy to configure and use for simple http request/response scenarios.
You can currently download the binary distribution tcpmon-1.0-bin.zip from the archive download page: http://archive.apache.org/dist/ws/tcpmon/1.0.
Unzip tcpmon-1.0-bin.zip to a folder, and go to its bin folder. Run the bat file or sh file based on your operating system. TCPMon will start with two tabs named Admin and Sender. In this exercise we are concerned only about Admin, which is a simple UI with option to set listen port, target port and host, along with some other parameters.
If your port from the original request URL is 8080, then you need to add it as the target port and then give any non-standard value as the listen port, and finally click add. When you run your URL, now you have to use the listen port instead of the standard port. You will actually be sending request to the TCPMon and then TCPMon will forward that request to the original host and port. You can also simulate slow connection from TCPMon through Admin tab.
For example, if your original request URL is http://localhost:8080/Form-Processing/UploadForm.html, you need to add 8080 to target and any other non-standard port, say 8888 as the listening port. Now you should run the URL as http://localhost:8888/Form-Processing/UploadForm.html. You will now see the request and response captured at the listening tab of tcpmon.
Wireshark may a better alternative. Tcpmon will require your request to be sent to another port configured in the tcpmon than original port, and then tcpmon will capture the request and forward it to the original port. Similarly, it captures the response as well. While using wireshark, you don’t have to make any change to the request url. However wireshark does a lot of extra things and hence might take a little more time to learn and configure.