forked from KNEMC/KLALB
隧道链接改成标准URI格式
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user