KLALB V3.4

This commit is contained in:
Administrator
2025-11-15 11:08:16 +08:00
parent 306bfd36f7
commit 8842566ee2
160 changed files with 18540 additions and 4512 deletions
@@ -8,6 +8,7 @@ import java.io.Reader;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.NetworkInterface;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
@@ -47,7 +48,7 @@ public class KLALBProxySystem {
private Gson gson;
private File jsonFile;
{
GsonBuilder gb=new GsonBuilder();
GsonBuilder gb=new GsonBuilder().setPrettyPrinting();
MultipurposeSocketAddress.registerToGsonBuilder(gb);
KLALBConfigItem.registerToGsonBuilder(gb);
gson=gb.create();
@@ -169,7 +170,7 @@ public class KLALBProxySystem {
String vsne=kcci.getVirtualSocketName();
//if(vsne!=null) {
MultipurposeSocketAddress.getSocketTypeRegister().put(vsne, klalbController.getSocketType());
MultipurposeSocketAddress.getSocketTypeRegister().put(vsne, klalbController.getStreamSocketType());
//}
MultipurposeSocketAddress tcple=kcci.getTCPListen();
if(tcple!=null) {
@@ -180,7 +181,7 @@ public class KLALBProxySystem {
tcpl.setCon((soc)->{
KLALBRemoteLine krs=null;
KLALBRemoteLine krs=null;
try {
krs = new KLALBRemoteLine(new StreamChannelKLALBPacketLink(soc));
klalbController.addRemoteLine(krs);
@@ -220,10 +221,7 @@ public class KLALBProxySystem {
}
List<MultipurposeSocketAddress> linele=kcci.getLineTable();
if(linele!=null) {
linele.forEach((aline)->{
klalbController.getSelflineTable().add(aline);
});
klalbController.getSelflineTable().addAll(linele);
}
List<MultipurposeSocketAddress> linetoc=kcci.getConnectLineTable();
if(linetoc!=null) {
@@ -231,6 +229,24 @@ public class KLALBProxySystem {
klalbController.addRemoteLines(aline);
});
}
List<MultipurposeSocketAddress> ntps=kcci.getNtpServerTable();
if(ntps!=null) {
klalbController.getNTPTable().addAll(ntps);
}
List<String> strexc=kcci.getNetworkInterfaceExcepts();
klalbController.getNetworkInterfaceExcept().clear();
if(strexc!=null) {
for(String strexci:strexc) {
try {
klalbController.getNetworkInterfaceExcept().add(NetworkInterface.getByName(strexci));
} catch (SocketException e) {
e.printStackTrace();
}
}
}
}else if(item instanceof SocketBridgeConfigItem) {
SocketBridgeConfigItem scci=(SocketBridgeConfigItem) item;
try {