隧道链接改成标准URI格式

This commit is contained in:
2026-07-11 22:28:50 +08:00
parent 053450429c
commit 314f90b5f3
66 changed files with 1578 additions and 1506 deletions
@@ -29,7 +29,7 @@ public class KLALBProxySystem {
private File jsonFile;
{
GsonBuilder gb=new GsonBuilder().setPrettyPrinting();
MultipurposeSocketAddress.registerToGsonBuilder(gb);
MultiProtocolSocketAddress.registerToGsonBuilder(gb);
KLALBConfigItem.registerToGsonBuilder(gb);
gson=gb.create();
}
@@ -63,7 +63,7 @@ public class KLALBProxySystem {
}
}
public void enableRemoteManagement(MultipurposeSocketAddress bind) throws IOException {
public void enableRemoteManagement(MultiProtocolSocketAddress bind) throws IOException {
if(krm==null) {
krm=new KLALBRemoteManagement(this,bind);
}else {
@@ -84,13 +84,17 @@ public class KLALBProxySystem {
public void loadConfigJson(File jsonFile) throws IOException {
this.jsonFile=jsonFile;
FileReader fr = null;
try {
fr=new FileReader(jsonFile);
loadConfigJson(fr);
}finally {
if(fr!=null)
fr.close();
if(jsonFile.exists()) {
FileReader fr = null;
try {
fr = new FileReader(jsonFile);
loadConfigJson(fr);
} finally {
if (fr != null)
fr.close();
}
}else{
loadConfig(KLALBConfig.getDefault());
}
}
@@ -128,9 +132,9 @@ public class KLALBProxySystem {
String vsne=kcci.getVirtualSocketName();
//if(vsne!=null) {
MultipurposeSocketAddress.getSocketTypeRegister().put(vsne, klalbController.getStreamSocketType());
MultiProtocolSocketAddress.getSocketTypeRegister().put(vsne, klalbController.getStreamSocketType());
//}
MultipurposeSocketAddress tcple=kcci.getTCPListen();
MultiProtocolSocketAddress tcple=kcci.getTCPListen();
if(tcple!=null) {
SocketChannelListener tcpl = null;
@@ -148,13 +152,13 @@ public class KLALBProxySystem {
}
});
MultipurposeSocketAddress mpsa2=new MultipurposeSocketAddress(tcple.getType(), tcple.getHost(),((InetSocketAddress)tcpl.getServerSocketChannel().getLocalAddress()).getPort());
MultiProtocolSocketAddress mpsa2=new MultiProtocolSocketAddress(tcple.getProtocol(), tcple.getHost(),((InetSocketAddress)tcpl.getServerSocketChannel().getLocalAddress()).getPort());
klalbController.getListenSocketAddress().add(mpsa2);
} catch (IOException e1) {
e1.printStackTrace();
}
}
MultipurposeSocketAddress udple=kcci.getUDPListen();
MultiProtocolSocketAddress udple=kcci.getUDPListen();
if(udple!=null) {
DatagramSocketListener udpl = null;
try {
@@ -171,7 +175,7 @@ public class KLALBProxySystem {
}
});
MultipurposeSocketAddress mpsau2=new MultipurposeSocketAddress(udple.getType(), udple.getHost(),((InetSocketAddress)(udpl.getDatagramServerSocket().getLocalSocketAddress())).getPort());
MultiProtocolSocketAddress mpsau2=new MultiProtocolSocketAddress(udple.getProtocol(), udple.getHost(),((InetSocketAddress)(udpl.getDatagramServerSocket().getLocalSocketAddress())).getPort());
//klalbController.getListenSocketAddress().add(mpsau2);
} catch (IOException e1) {
e1.printStackTrace();