A really small and dumb man in the middle watcher for network traffic. Helps with debugging.
Producer <--> man_in_the_middle <--> Server
dev_machine_ip:localport remotehost:remoteport
Producer (data source) connects to "localport" on the developer machine (not to the original data sink/server any more)
man_in_the_middle does a raw forwarding but also print out the traffic. Here we must setup remotehost:remoteport to the original data sink/server, where the Producer originally connected to.
Keep "localhost" setting at "0.0.0.0" listening to all interfaces for Producer; you are insecure anyways ;)
Works well for HTTP traffic sniffing and troubleshooting (especially debugging http-headers)
Should run on any Python 3.6+ and only standard libraries installed. Tested with Windows and Linux.
- Script must be ended by killing the interpreter process