隧道链接改成标准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
+3 -9
View File
@@ -1,13 +1,7 @@
package org.kne.cloud.network;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.*;
import java.nio.ByteBuffer;
import java.nio.channels.*;
import java.nio.channels.spi.AbstractInterruptibleChannel;
import java.util.*;
public class PortRelay {
private int port;
@@ -16,8 +10,8 @@ public class PortRelay {
public PortRelay(int port, HostPortMap services) throws IOException {
this.services = services;
this.port = port;
MultipurposeSocketAddress.getSocketTypeRegister().put("ProtocolDetectorServerSocket",new SocketType(null, new ProtocolDetectorServerSocketFactory()) );
ssc=new SocketListener(new MultipurposeSocketAddress("ProtocolDetectorServerSocket", "0.0.0.0", port));
MultiProtocolSocketAddress.getSocketTypeRegister().put("ProtocolDetectorServerSocket",new SocketType(null, new ProtocolDetectorServerSocketFactory()) );
ssc=new SocketListener(new MultiProtocolSocketAddress("ProtocolDetectorServerSocket", "0.0.0.0", port));
}
public void start() throws IOException {
ssc.setCon((s)->{
@@ -30,7 +24,7 @@ public class PortRelay {
}else {
nx=pds.getProtocolStack().pop().getName();
}
MultipurposeSocketAddress hp=services.get(nx);
MultiProtocolSocketAddress hp=services.get(nx);
InetSocketAddress sa=(InetSocketAddress) s.getRemoteSocketAddress();
System.out.println(sa.getAddress().getHostAddress() + ":" + port
+ "-" + "(" + nx + ")->" + hp.getHost() + ":" + hp.getPort());