Last Updated: February 25, 2016
·
1.297K
· zohebsait

Simple TCP port forwarding and capture with Grinder

I have been looking for a simple tool to intercept and log HTTP conversations and stumbled upon Grinder.

Grinder is a pretty powerful load testing tool, but one of the things it comes with a simple port forwarder.

Here's how you use it, simply download Grinder, and update your CLASSPATH to include the grinder.jar provided in the lib folder.

Then,

java net.grinder.TCPProxy -remotehost example.com -remoteport 8082 -localport 8000 | tee /tmp/dump1

This will listen on localhost port 8000 and forward any requests it receives to example.com port 8082, while logging everything to /tmp/dump1 and stdout.