Skip to content

Add QUIC support. - #5435

Merged
mhils merged 135 commits into
mitmproxy:mainfrom
meitinger:quic
Nov 28, 2022
Merged

mhils merged 135 commits into
mitmproxy:mainfrom
meitinger:quic

Conversation

@meitinger

@meitinger meitinger commented Jun 27, 2022 •

Copy link
Copy Markdown
Contributor

Description

This is the PR for QUIC support in mitmproxy.

Checklist

  • Stream and datagram relay layer for arbitrary protocols. (See also Add support for raw UDP. #5414)
  • Support TlsClienthelloHook, TlsFailedClientHook and TlsEstablishedClientHook.
  • Use hooks for TLS settings (QuicTlsStartClientHook and QuicTlsStartServerHook).
  • Implement Http3Client and Http3Server.
  • Support NextLayer decisions.
  • Extended UDP implementation to support connection roaming. [dropped by request]
  • Implement and test upstream mode and via handling (if possible). [postponed until UDP/TCP mode merge]
  • Write tests.
  • Add entry to CHANGELOG.

@meitinger
meitinger marked this pull request as ready for review November 27, 2022 05:02

@mhils mhils left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉🎉🎉

@mhils
mhils enabled auto-merge November 28, 2022 17:19
@mhils
mhils force-pushed the quic branch 2 times, most recently from 4dd07c5 to 353627b Compare November 28, 2022 17:36
@mhils
mhils merged commit 8b74cbe into mitmproxy:main Nov 28, 2022
@NKShukla

NKShukla commented Dec 12, 2022 •

Copy link
Copy Markdown

@mhils @meitinger, have you guys rolled out this feature in the latest release?

@mhils

mhils commented Dec 12, 2022

Copy link
Copy Markdown
Member

This will be part of the next major release, but is only on the main branch for now.

@ShellCode33

Copy link
Copy Markdown

Hey, thanks for your amazing work ! I'm willing to try this out but I'm unable to route UDP trafic through mitmproxy.

I'm running mitmproxy using transparent mode but it doesn't seem to be listening for incoming UDP packets:

$ ss -lapute | grep mitmproxy
tcp  LISTEN  0  100   0.0.0.0:http-alt   0.0.0.0:*   users:(("mitmproxy",pid=265930,fd=6)) uid:1000 ino:3299559 sk:5001 cgroup:/user.slice/user-1000.slice/session-3.scope <->

Is there any CLI parameter that would trigger UDP listening ?

I'm using the HEAD of the main branch.

@mhils

mhils commented Feb 9, 2023

Copy link
Copy Markdown
Member

@ShellCode33: QUIC support is very much experimental/undocumented/opt-in at the moment - there's still a ton of work ahead of us (with no clear timeline yet).

You can start experimenting with it by running mitmdump --mode http3 or something like mitmdump --mode reverse:http3://example.com. Feedback is welcome. :)

@ShellCode33

Copy link
Copy Markdown

Thanks ! However it only listens to UDP, is there a way to listen to both TCP and UDP ? In order to support all HTTP versions at once.

@mhils

mhils commented Feb 9, 2023

Copy link
Copy Markdown
Member

You can pass --mode multiple times. :)

@3052

3052 commented Dec 12, 2023

Copy link
Copy Markdown

doesnt work for me:

mitmproxy-10.1.5-windows> mitmdump --mode http3
mitmproxy-10.1.5-windows\mitmdump.exe: Invalid proxy mode specification: http3
(unknown mode)

@ShellCode33

Copy link
Copy Markdown

IIRC it is not supported. This PR adds some useful primitives to allow mitmproxy to support QUIC at some point, but this is not enough to intercept QUIC traffic transparently yet.

@mhils

mhils commented Dec 13, 2023 via email

Copy link
Copy Markdown
Member

@3052

3052 commented Dec 13, 2023 •

Copy link
Copy Markdown

OK so it seems I have to scope the interception to a single domain for time being? but even with that, if I start the proxy and try to enable with Android Studio, it says "Proxy is unreachable", where if I just run the normal mitmproxy its fine. so how do I intercept HTTP/3 with MITM Proxy?

@ShellCode33

Copy link
Copy Markdown

and try to enable with Android Studio

I guess you are trying to use the built-in proxy feature of the emulator ?

The emulator does not support UDP proxifying.

From the documentation :

The -http-proxy option forces the emulator to use the specified HTTP or HTTPS proxy for all outgoing TCP connections. Redirection for UDP is not supported.

HTTP3 works over QUIC, which works over UDP. Therefore you either have to setup a wireguard tunnel, or use the TPROXY feature of the Linux kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants