Search code examples
httpubuntufirefoxhttpresponsepacket-sniffers

Reading Incoming HTTP Response Bodies to CLI


There's a simple game that my friends and I play both in person and and online. I developed a CLI that records our in-person games (I just type in each move), but I now want to use it to record our online games. All I need to do is pipe the HTTP response bodies being sent to my browser (Firefox) to my CLI. Unfortunately. I can't figure out how to do this.

Ideally, I'm looking for a Ubuntu package that I can run from the command line that will capture and return all HTTP response bodies from a specific endpoint. I've looked into tcpdump and some simple proxy servers, but I'm not sure they do what I want them to do.

Thanks for your help! Let me know if I need to provide any further information!


Solution

  • I used MITMProxy as ZachChilders recommended in the comments. I found it somewhat difficult to get set up, so I'll include what directions I followed to get it up and running:

    1) Install MITMProxy.

    2) Configure Firefox.

    3) Create Add On to parse body.

    4) Stream data via Python to CLI (TODO).