A production-quality, RFC-compliant SOCKS5 proxy server built with Java 21 and Netty 4. Designed for deployment on a Pterodactyl Java container as a private proxy.
- RFC 1928 SOCKS5 - Full protocol support (CONNECT, UDP ASSOCIATE)
- RFC 1929 Authentication - Username/password auth with multiple users
- IPv4/IPv6/Domain - All SOCKS5 address types
- UDP ASSOCIATE - Standards-compliant UDP relay with SOCKS5 packet format
- HTTP CONNECT - Optional HTTP/HTTPS tunnel proxy (disabled by default)
- Configurable - Full YAML configuration
- Secure - Connection limits, timeouts, input validation, no password logging
- Pterodactyl Ready - Single JAR, no root/systemd/Docker required
JarProxy/
├── Main.java - Entry point, startup, shutdown hook
├── Config.java - YAML configuration loader & validator
├── ProxyLogger.java - Timestamped console logging
├── AuthenticationManager.java - User credential management
├── ConnectionLimiter.java - TCP/UDP connection limits
├── Socks5Server.java - Netty SOCKS5 TCP listener
├── Socks5ClientHandler.java - SOCKS5 protocol state machine
├── TcpRelay.java - Bidirectional TCP data relay
├── UdpAssociate.java - SOCKS5 UDP ASSOCIATE relay
└── HttpConnectServer.java - HTTP CONNECT tunnel proxy
- Java 21 (JDK)
- Apache Maven 3.9+
cd JarProxy
mvn clean package -DskipTeststarget/JarProxy.jar
mvn clean packageThe first run creates config.yml automatically. Edit it before starting:
server:
host: "0.0.0.0"
port: 1080
authentication:
enabled: true
users:
- username: "proxyuser"
password: "CHANGE_THIS_PASSWORD"
network:
tcp:
enabled: true
udp:
enabled: true
timeouts:
connection: 10000
idle: 300000
limits:
max_connections: 500
max_udp_associations: 200
logging:
level: "INFO"
log_connections: true
log_authentication_failures: true
log_destination: false
http_proxy:
enabled: false
port: 8080| Option | Description |
|---|---|
server.host |
Bind address (use 0.0.0.0 for Pterodactyl) |
server.port |
SOCKS5 listening port |
authentication.enabled |
Enable/disable username/password auth |
authentication.users |
List of username/password pairs |
network.tcp.enabled |
Enable TCP CONNECT support |
network.udp.enabled |
Enable UDP ASSOCIATE support |
timeouts.connection |
TCP connect timeout (ms) |
timeouts.idle |
Idle connection timeout (ms) |
limits.max_connections |
Maximum simultaneous TCP connections |
limits.max_udp_associations |
Maximum simultaneous UDP associations |
logging.level |
TRACE, DEBUG, INFO, WARN, ERROR |
logging.log_connections |
Log connect/disconnect events |
logging.log_authentication_failures |
Log failed auth attempts |
logging.log_destination |
Log proxy destinations (privacy risk) |
http_proxy.enabled |
Enable HTTP CONNECT proxy |
http_proxy.port |
HTTP CONNECT listening port |
- In Pterodactyl Panel, create a new Java server
- Select Java 21 (or latest available)
- Set the startup command to:
java -jar JarProxy.jar - Note the allocation port assigned by Pterodactyl
Upload target/JarProxy.jar to your server's /home/container/ directory via:
- Pterodactyl File Manager
- SFTP (use your Pterodactyl credentials)
Edit config.yml to use the Pterodactyl allocation port:
server:
host: "0.0.0.0"
port: 25565 # Use your Pterodactyl allocation portChange the default password immediately:
authentication:
enabled: true
users:
- username: "myuser"
password: "YOUR_SECURE_PASSWORD_HERE"Click Start in the Pterodactyl Panel, or:
java -jar JarProxy.jarOn your VPS, ensure the port is open:
# UFW
sudo ufw allow 25565/tcp
# iptables
sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPTFor UDP support (SOCKS5 UDP ASSOCIATE), also allow UDP:
sudo ufw allow 25565/udpProxy type: SOCKS5
Host: YOUR_VPS_IP
Port: 1080
Username: proxyuser
Password: YOUR_PASSWORD
- Open Settings > Network & Internet > Proxy
- Enable Use a proxy server
- Set address:
YOUR_VPS_IP - Set port:
1080 - Check Don't use proxy for local addresses
- Open Firefox > Settings > Network Settings
- Select Manual proxy configuration
- SOCKS Host:
YOUR_VPS_IP - Port:
1080 - Select SOCKS v5
- Check Proxy DNS when using SOCKS v5
# Using curl through the proxy
curl -x socks5://proxyuser:password@YOUR_VPS_IP:1080 http://httpbin.org/ip
# Using netcat through the proxy (if you have a SOCKS-capable netcat)Use a SOCKS5-capable UDP client. The proxy will:
- Return a UDP bind port on TCP control connection
- Accept SOCKS5 UDP packets on that port
- Relay data to/from the target
curl -x http://proxyuser:password@YOUR_VPS_IP:8080 http://httpbin.org/ipmvn testThis proxy implements standards-compliant SOCKS5 UDP ASSOCIATE. However:
- Some applications use non-standard networking that may be incompatible
- UDP relay adds latency
- Not all games will work through a SOCKS5 UDP relay
- This is a general-purpose proxy, not a game-specific tool
- Change the default password immediately
- Use strong passwords (16+ characters)
- Enable authentication (don't run as open proxy)
- Restrict connections to your IP if possible
- Monitor logs for unauthorized access attempts
- Keep Java updated to the latest version
- Use firewall rules to limit access
Server won't start:
- Check Java version:
java -version - Check port availability:
netstat -tlnp | grep 1080 - Check config.yml syntax
Can't connect:
- Verify the port is open in your firewall
- Check the server is listening:
netstat -tlnp | grep <port> - Verify credentials match config.yml
- Check server logs for errors
UDP not working:
- Ensure UDP is enabled in config.yml
- Ensure UDP port is open in firewall
- Some NAT configurations may interfere
Pterodactyl issues:
- Ensure the allocation port matches config.yml
- Check the server console for startup errors
- Verify
java -jar JarProxy.jarworks in the container
Private use. Not for distribution as a public proxy service.