java-socks-proxy-server is a SOCKS 4/5 server for Java. Includes a JUnit Rule for easy testing with a SOCKS server.
It is a continuation of https://github.com/damico/java-socks-proxy-server.
<dependency>
<groupId>com.github.bbottema</groupId>
<artifactId>java-socks-proxy-server</artifactId>
<version>1.1.0</version>
</dependency>
SocksServer socksServer = new SocksServer();
socksServer.start(100); // start serving clients on port 100
socksServer.start(200); // start serving clients on port 200
socksServer.start(300, myCustomServerSocketFactory); // eg. SSL on port 300
socksServer.stop(); // stops server on all ports
For use in junit tests:
@ClassRule
public static final SockServerRule sockServerRule = new SockServerRule(PROXY_SERVER_PORT);
// or
@ClassRule
public static final SockServerRule sockServerRule = new SockServerRule(PROXY_SERVER_PORT, myServerSocketFactory);
And that's it!
v1.1.0 (15-April-2021)
- #4 added support for custom server socket factory (so you are free to configure SSL)
v1.0.2 (5-July-2020)
- Bumped log4j-core from 2.6.1 to 2.13.2
v1.0.1 (6-December-2019)
- Removed Jacoco instrumentation from production code
v1.0.0 (6-December-2019)
Initial release
4-December-2019
Initial upload