Can I Theme, or Change the Title or Appearance, of Mitmweb?

279 Views Asked by At

I have a setup with two mitmproxy interfaces - one for incoming traffic, and one for outgoing. This is to wrap an applicatiomn server so I can debug what happened post-mortem, for example.

I just had an outage and almost made an incorrect conclusion, because the two interfaces look the same, and the requests coming in and going out are similar - my app server is communicating with the same third-party in most flows. The two are accessed from two different ports, and I can't remember which way round those teo are off the top of my head.

I'd therefore like to change the mitmweb interface to help me differentiate. Apply a theme or colour scheme, or add a clear header or title in the page that helps me see quickly which is incoming and which outgoing. Therefore, if an unexpected outage arises again in the future, it will help me with gathering evidence, when there's a lot of noise going on that I can easily get confused.

I don't see anything in the config options that will let me change the visual appearance of mitmweb. Does anyone know any config items I can change that might help me achieve something like this please?

Thanks

(For info: I am currently using the official container image, on the slightly old 6.0.2 version)

1

There are 1 best solutions below

1
Maximilian Hils On

There are no theming options for mitmweb at the moment. What you could do is add custom CSS to https://github.com/mitmproxy/mitmproxy/blob/main/mitmproxy/tools/web/templates/index.html. Make sure that you select the base template for the right version. :)