mitmproxy icon indicating copy to clipboard operation
mitmproxy copied to clipboard

Support custom wireguard options

Open tomlawesome opened this issue 5 months ago • 1 comments

Problem Description

I wish to use custom WG configuration, instead of hard-coded values in the python, I read https://github.com/mitmproxy/mitmproxy/pull/5562#pullrequestreview-1099934509 and I understand the desire to not have lots of code to parse existing configs.

Proposal

Add additional options to the wireguard.conf file. The pub/priv keys are already stored here, and other variables could also be stored here too, such is IPs, listen ports for both instance/peer/dns and in particular, endpoint.

The file could easily be populated by default with the static config already there, which would provide customisation at no expense to those who do not wish to manually enter anything.

Alternatives

There is not really one that requires less effort, but the alternative would be to allow the use of standard wireguard config formats.

Additional context

In my case I have an LTE router at another location and I want to connect mitmproxy via my existing wireguard setup, which uses a FQDN as a means of conveying the current IP, due to having a dynamic one so that I can proxy the webUIs available there over the tunnel.

It would also be nice one day to reintroduce the multi-peer support so one instance of MITM can serve multiple remote locations or devices without having to share a common WG tunnel.

tomlawesome avatar Feb 02 '24 16:02 tomlawesome

Which specific additional options would you want to add, and which additional use cases do they enable?

It would also be nice one day to reintroduce the multi-peer support

FWIW, you can already pass --mode multiple times and serve multiple users from different ports.

mhils avatar Feb 02 '24 23:02 mhils