ensureSocks5Udp

suspend fun ensureSocks5Udp(relay: UdpSocket? = null): Socks5UdpAssociation?

Lazily open a SOCKS5 UDP ASSOCIATE relay over the configured proxy so UDP transports (uTP/DHT/UDP-trackers) can be tunnelled, the port of libtorrent's socks5::socks_forward_udp. Returns the live association (also stored for teardown), or null if the proxy isn't SOCKS5 or the negotiation failed. The relay socket and control connection are owned by the association.

relay is the UDP socket the wrapped datagrams physically transit; when the engine wires the shared listen socket through the proxy it passes that socket here so there is one physical socket. Callers with no socket of their own omit it and an ephemeral relay is bound.