Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

expose original source address of WireGuard UDP packets in TcpStream #22

Merged
merged 1 commit into from Nov 6, 2022

Conversation

decathorpe
Copy link
Owner

The source socket of WireGuard UDP packets (i.e. the socket address of the WireGuard client outside the WireGuard tunnel) can now be accessed with TcpStream.get_extra_info("original_src").

There's currently no way to do the same for UDP packets, since the callback for received UDP packets only accepts (payload, src_addr, dst_addr) as arguments.

The source socket of WireGuard UDP packets (i.e. the socket address of
the WireGuard client *outside* the WireGuard tunnel) can now be accessed
with `TcpStream.get_extra_info("original_src")`.
@decathorpe
Copy link
Owner Author

Adding this was pretty simple and it doesn't make the code more complicated than it already is.
Even if it ends up being unused by mitmproxy, it's nice for debugging (I also included it in the output TcpStream.__repr__() to match original_dst which was already there).

@decathorpe decathorpe merged commit 467b696 into main Nov 6, 2022
@decathorpe decathorpe deleted the original-source branch November 6, 2022 20:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant