Download raw body.
mitmproxy and debug message in console
On Wed, 30 Apr 2025 01:04:16 +0200,
LWS <mediomen27@gmail.com> wrote:
>
> hello,
> i hope this is the correct mailing list.
> i installed mitmproxy on an openbsd virtual machine on vmm, then i updated
> both the vm and the host to openbsd 7.7.
> i have a problem with mitmproxy because when i launch it on the terminal in
> ssh i don't get the gui interface but a whole series of debug messages that
> make the software unusable.
> i tried several things to remove these messages and they are the following:
>
> # mitmproxy --quiet
> # mitmproxy -v
> # mitmproxy --set verbosity=warn
> # mitmproxy -n --quiet
> # mitmproxy --quiet --set verbosity=warn
>
> without getting any results.
> i uploaded a screenshot to the following url. The screenshot is made on the
> vm console but in ssh it is the same thing. As you can see, it's not that
> the program doesn't work.. as you can see the exit confirmation message by
> pressing the q key but only that the debug messages appear.
> I also opened a discussion in the discussion section on the github page of
> the software.
> screen --> https://ibb.co/zhfBvLrR
> Thanks for any help.
Yes, this is the right list and thanks for a bug report!
I usually use only mitmweb and it was a reason why it wasn't noticed.
The good news that this issue was fixed in version 12.0.0 which was released
yesterday, and I plan to send a diff to update it in -current later today.
Anyway, here a backport of the fix for 7.7.
Ok for -stable?
Index: security/mitmproxy/Makefile
===================================================================
RCS file: /cvs/ports/security/mitmproxy/Makefile,v
diff -u -p -r1.9 Makefile
--- security/mitmproxy/Makefile 26 Feb 2025 19:31:11 -0000 1.9
+++ security/mitmproxy/Makefile 30 Apr 2025 10:24:29 -0000
@@ -1,6 +1,7 @@
COMMENT = interactive intercepting HTTP proxy
MODPY_DISTV = 11.1.3
+REVISION = 0
DISTNAME = mitmproxy-${MODPY_DISTV}
Index: security/mitmproxy/patches/patch-mitmproxy_tools_console_window_py
===================================================================
RCS file: security/mitmproxy/patches/patch-mitmproxy_tools_console_window_py
diff -N security/mitmproxy/patches/patch-mitmproxy_tools_console_window_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ security/mitmproxy/patches/patch-mitmproxy_tools_console_window_py 30 Apr 2025 10:24:29 -0000
@@ -0,0 +1,21 @@
+Backport: https://github.com/mitmproxy/mitmproxy/pull/7676
+
+Index: mitmproxy/tools/console/window.py
+--- mitmproxy/tools/console/window.py.orig
++++ mitmproxy/tools/console/window.py
+@@ -1,3 +1,4 @@
++import logging
+ import re
+
+ import urwid
+@@ -304,6 +305,10 @@ class Window(urwid.Frame):
+
+
+ class Screen(urwid.raw_display.Screen):
++ def __init__(self) -> None:
++ super().__init__()
++ self.logger = logging.getLogger("urwid")
++
+ def write(self, data):
+ if common.IS_WINDOWS_OR_WSL:
+ # replace urwid's SI/SO, which produce artifacts under WSL.
Index: security/mitmproxy/patches/patch-mitmproxy_tools_main_py
===================================================================
RCS file: security/mitmproxy/patches/patch-mitmproxy_tools_main_py
diff -N security/mitmproxy/patches/patch-mitmproxy_tools_main_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ security/mitmproxy/patches/patch-mitmproxy_tools_main_py 30 Apr 2025 10:24:29 -0000
@@ -0,0 +1,13 @@
+Backport: https://github.com/mitmproxy/mitmproxy/pull/7676
+
+Index: mitmproxy/tools/main.py
+--- mitmproxy/tools/main.py.orig
++++ mitmproxy/tools/main.py
+@@ -58,6 +58,7 @@ def run(
+ logging.getLogger("tornado").setLevel(logging.WARNING)
+ logging.getLogger("asyncio").setLevel(logging.WARNING)
+ logging.getLogger("hpack").setLevel(logging.WARNING)
++ logging.getLogger("urwid").setLevel(logging.INFO)
+ logging.getLogger("quic").setLevel(
+ logging.WARNING
+ ) # aioquic uses a different prefix...
--
wbr, Kirill
mitmproxy and debug message in console