Repository navigation
Multi-Server Mode - #5393
Multi-Server Mode#5393
Conversation
|
This looks remarkably similar to what I looked into doing just earlier today. |
If there's only one
Looks good and should work well :) @abstractmethod
def build_connection_id(
self,
transport: asyncio.DatagramTransport,
data: bytes,
remote_addr: Address,
local_addr: Address,
) -> Optional[str]:
pass
@property
@abstractmethod
def timeout(self) -> int:
passBecause creating a task for new connections or adding packets to an existing one should be the same for most UDP servers. If EDIT: The preliminary |
|
I was thinking what if we deprecate |
meitinger
left a comment
There was a problem hiding this comment.
Looks great, especially having server instance classes (and proxy modes) with your __init_subclass__ method will allow for cleaner code and easier maintenance/extensibility, very cool!
Once #5393 lands I'll update #5435 and introduce a common UdpServerInstance for DnsInstance, QuicInstance and other.
ce5e20a to
ad7bdca
Compare
This commit makes it possible for mitmproxy to spawn multiple TCP/UDP proxy servers at the same time, see mitmproxy#5288
This is a very-much-work-in-progress implementation of the multi proxy mode discussed in #5288:
Tests are still failing, but the invocation above works. There are a few minor changes on the latest dicussions:
flow.client_conn.sockname" was of course spot-on. There are some legitimate cases where we need this (e.g. proxyauth) andClient.proxy_modeis a thing now. 😄dns/regular-dns/... wording isn't fully fleshed out yet, we can make final decisions here once we have a raw UDP layer and/or QUIC.mitmproxy/proxy/mode_specs.pyandmitmproxy/proxy/mode_servers.pymake sense to you? Does that work for WireGuard/QUIC?TODO:
listen_hostandlisten_port.