You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My plan is to add an additional constructor for SimpleResolver to pass the necessary parameters and add the SOCKS Handshake here in SimpleResolver.java in the sendAsync method.
CompletableFuture<byte[]> result;
if (tcp) {
// add SOCKS5 Handshake for TCP
result =
ioClientFactory
.createOrGetTcpClient()
.sendAndReceiveTcp(localAddress, address, query, out, timeoutValue);
} else {
// add SOCKS5 Handshake for UDP
result =
ioClientFactory
.createOrGetUdpClient()
.sendAndReceiveUdp(localAddress, address, query, out, udpSize, timeoutValue);
}
Yes. I should be able to use the ioClientFactory for the SOCKS Handshake for TCP and UDP and implement it without any additional dependencies.
Yes, I plan to refactor the changes into the IoClients. Handling UDP is tricky. I have to strip the SOCKS UDP header from the UDP reply. And the TCP connection to setup the UDP associate have to stay open till the UDP transmission has finished. Otherwise I get java.net.PortUnreachableException.
Activity
ibauersachs commentedon Sep 23, 2024
Hey,
Sure, support for this would be welcome.
However, I don't want a dependency on another library and ideally it would be possible to reuse existing APIs of dnsjava (TcpIoClient/UdpIoClient).
Feel free to create a PR, but I won't be able to review anything in the following weeks.
Thanks,
Ingo
tw-datascientist commentedon Sep 24, 2024
Sounds good.
My plan is to add an additional constructor for SimpleResolver to pass the necessary parameters and add the SOCKS Handshake here in SimpleResolver.java in the sendAsync method.
Yes. I should be able to use the ioClientFactory for the SOCKS Handshake for TCP and UDP and implement it without any additional dependencies.
I'll prepare a PR.
ibauersachs commentedon Oct 1, 2024
Please try to avoid any changes in SimpleResolver. If the handshake is in the IoClients anyway, I don't think it would be neccessary.
tw-datascientist commentedon Oct 2, 2024
Hi @ibauersachs,
I have a first working solution. master...tw-datascientist:dnsjava:master
Yes, I plan to refactor the changes into the IoClients. Handling UDP is tricky. I have to strip the SOCKS UDP header from the UDP reply. And the TCP connection to setup the UDP associate have to stay open till the UDP transmission has finished. Otherwise I get
java.net.PortUnreachableException.My guess is that the best approach is to move this logic into the
processReadyKeymethod inNioUdpClient.java.tw-datascientist commentedon Oct 3, 2024
I refactored the changes into the IoClients.
master...tw-datascientist:dnsjava:master