Mitmweb appears to only flush to save-stream-file on exit

The description of the --save-stream file option on mitmweb, when run on Linux, says “Stream flows to file as they arrive.” This implies that data is written to the stream file as it is received. However, it seems that data is only flushed to the file when the process is stopped. Is there another option that needs to be present to force immediate flushing when a flow arrives or is this a bug? Thx!

Update: After further testing it appears that data is flushed to the file somewhere around 100-110K. It would be useful to be able to adjust this to be more immediate, if anyone knows if such an option exists.

1 Like