Simple Logging HTTP Proxy with Grinder
source link: https://blog.jakubholy.net/2011/07/28/simple-logging-http-proxy-with-grinder/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Simple Logging HTTP Proxy with Grinder
Grinder is a Java load testing framework and the proxy is just a part of it. Here is how you would start the proxy to forward local port 6080 to the remote address example.webservices.com:80 and log the HTTP communication into a file:
java -cp lib/grinder.jar net.grinder.TCPProxy -console -localhost 127.0.0.1 -localport 6080 -remotehost example.webservices.com -remoteport 80 > http.log
The optional flag
-console
makes it to display a window for shutting it down cleanly (likely unnecessary under Linux/Mac). When you want it to log just into the console, add -colour
for nicely colored output.Run it with
-?
to see all the available options.
Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.
Allow me to write to you!
Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK