org.rx.net.socks.SocksConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxlib Show documentation
Show all versions of rxlib Show documentation
A set of utilities for Java
package org.rx.net.socks;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.rx.net.SocketConfig;
import org.rx.net.Sockets;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@RequiredArgsConstructor
@Getter
@Setter
@ToString
public class SocksConfig extends SocketConfig {
private static final long serialVersionUID = 3526543718065617052L;
private final int listenPort;
private int trafficShapingInterval = 10000;
private int readTimeoutSeconds = 60 * 4;
private int writeTimeoutSeconds;
private int udpAssociateMaxLifeSeconds = 60 * 60 * 12;
private int udpReadTimeoutSeconds = 60 * 20;
private int udpWriteTimeoutSeconds;
private boolean enableUdp2raw;
private List udp2rawServers;
@Getter(lazy = true)
private final Set whiteList = whiteList();
private Set whiteList() {
Set list = ConcurrentHashMap.newKeySet(1);
list.add(Sockets.getLoopbackAddress());
return list;
}
}