Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5ff82ed
added SOCKS5 support for DNS over tcp and udp (first working version)
Thomas-Internetx Oct 2, 2024
5a41225
refactored code for udp associate into IoClient
Thomas-Internetx Oct 3, 2024
bee0c76
added user/pwd authentication and refactored some of the code
Thomas-Internetx Oct 18, 2024
2a1192c
redo code changes in SimpleResolver and the IoClients
Thomas-Internetx Dec 5, 2024
80dfcb6
implemented SOCKS5 requests in an async way and added requested changes
Thomas-Internetx Dec 5, 2024
156c797
clean up
Thomas-Internetx Dec 5, 2024
3dae148
integration of SOCKS5 with the current selector thread and timeout im…
Thomas-Internetx Jan 10, 2025
8efe515
channel pool for UDP associate
tw-datascientist Jan 12, 2025
f9c1feb
integration the UDP channel pool
Thomas-Internetx Jan 12, 2025
9d0df8b
clean up of idle udp associate connections
Thomas-Internetx Jan 17, 2025
44f4415
further cleanup of the NioSocksHandler
Thomas-Internetx Jan 18, 2025
4cfaf31
better error handling
Thomas-Internetx Jan 18, 2025
07a6977
cleanup
Thomas-Internetx Jan 18, 2025
c365e36
adjustments for the socks5 handshake future
Thomas-Internetx Jan 18, 2025
260c4d5
Make compatible with Java 8
Thomas-Internetx Jan 18, 2025
02c3168
adjusting changes to upstream
Thomas-Internetx Jan 25, 2025
588df3d
clean up
Thomas-Internetx Jan 25, 2025
46a1b24
added testcontainer
Thomas-Internetx Jan 25, 2025
66a1e1d
adjusted corefile path
Thomas-Internetx Jan 25, 2025
ba1ea1c
adjusted corefile path
Thomas-Internetx Jan 25, 2025
baf40f2
adjusted docker compose setup
Thomas-Internetx Jan 25, 2025
ba11e90
adjusted docker compose setup
Thomas-Internetx Jan 25, 2025
8b71b09
implemented simple test for DNS over Socks
Thomas-Internetx Jan 25, 2025
c0ffa87
implemented simple test for DNS over Socks
Thomas-Internetx Jan 25, 2025
f36df78
implemented simple test for DNS over Socks
Thomas-Internetx Jan 25, 2025
240d206
implemented simple test for DNS over Socks
Thomas-Internetx Jan 25, 2025
c807b02
implemented simple test for DNS over Socks
Thomas-Internetx Jan 25, 2025
d0f3460
implemented simple test for DNS over Socks
Thomas-Internetx Jan 25, 2025
1f88de9
adjusting changes to upstream
Thomas-Internetx Jan 25, 2025
02ef998
adjusting changes to upstream
Thomas-Internetx Jan 25, 2025
3970b97
further clean up
Thomas-Internetx Jan 25, 2025
00bdea2
further clean up
Thomas-Internetx Jan 25, 2025
688fe6d
further clean up
Thomas-Internetx Jan 25, 2025
e94d15c
further clean up
Thomas-Internetx Jan 25, 2025
b621b32
improved comment for DST.ADDR and DST.PORT in the SOCKS handshake
Thomas-Internetx Jan 26, 2025
a12d004
improved comment for static registrationQueue and channelMap
Thomas-Internetx Jan 26, 2025
a8be13b
improved comment for response to future mapping
Thomas-Internetx Jan 26, 2025
fe2a79e
added step for docker setup
Thomas-Internetx Jan 26, 2025
73c0db0
set DOCKER_HOST
Thomas-Internetx Jan 26, 2025
99455be
reduced logs for Testcontainers
Thomas-Internetx Jan 26, 2025
fb3f015
fixed format violations
Thomas-Internetx Jan 26, 2025
938e726
fixed format violations
Thomas-Internetx Jan 26, 2025
b255bc3
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
10141bc
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
7caf075
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
fd301ba
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
3b62593
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
b97610d
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
4008b84
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
d416209
try to make Testcontainers work with windows https://java.testcontain…
Thomas-Internetx Jan 26, 2025
7b37e19
removed differentiation of remote address for SocksUdpAssociateChanne…
Thomas-Internetx Feb 9, 2025
d8dde40
fixed style
Thomas-Internetx Feb 10, 2025
be7245c
fixed style
Thomas-Internetx Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ jobs:
distribution: temurin
cache: maven

- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
set-host: true

- name: Build with Maven
shell: bash
run: |
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,13 @@
<version>0.16</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.20.4</version>
<scope>test</scope>
</dependency>

</dependencies>

<profiles>
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/org/xbill/DNS/NioSocks5ProxyConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: BSD-3-Clause
package org.xbill.DNS;

import java.net.InetSocketAddress;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class NioSocks5ProxyConfig {
private InetSocketAddress proxyAddress;
private AuthMethod authMethod;
private String socks5User;
private String socks5Password;

public enum AuthMethod {
NONE,
GSSAPI,
USER_PASS
}

public NioSocks5ProxyConfig(InetSocketAddress proxyAddress) {
this(proxyAddress, null, null);
authMethod = AuthMethod.NONE;
}

public NioSocks5ProxyConfig(
InetSocketAddress proxyAddress, String socks5User, String socks5Password) {
this.proxyAddress = proxyAddress;
this.socks5User = socks5User;
this.socks5Password = socks5Password;
authMethod = AuthMethod.USER_PASS;
}

// public Socks5ProxyConfig(InetSocketAddress proxyAddress, GSSCredential gssCredential) {
// this(proxyAddress, null, null, gssCredential);
// }
}
33 changes: 33 additions & 0 deletions src/main/java/org/xbill/DNS/NioSocks5ProxyFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: BSD-3-Clause
package org.xbill.DNS;

import java.util.Objects;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.xbill.DNS.io.IoClientFactory;
import org.xbill.DNS.io.TcpIoClient;
import org.xbill.DNS.io.UdpIoClient;

@Getter
@Slf4j
public class NioSocks5ProxyFactory implements IoClientFactory {
private final NioSocks5ProxyConfig config;
private final TcpIoClient tcpIoClient;
private final UdpIoClient udpIoClient;

public NioSocks5ProxyFactory(NioSocks5ProxyConfig socks5Proxy) {
config = Objects.requireNonNull(socks5Proxy, "proxy config must not be null");
tcpIoClient = new NioSocksTcpClient(config);
udpIoClient = new NioSocksUdpClient(config);
}

@Override
public TcpIoClient createOrGetTcpClient() {
return tcpIoClient;
}

@Override
public UdpIoClient createOrGetUdpClient() {
return udpIoClient;
}
}
Loading
Loading