1 package com.sslexplorer.tunnels.agent; 2 3 import java.io.IOException ; 4 5 import com.maverick.multiplex.ChannelOpenException; 6 import com.maverick.util.ByteArrayReader; 7 import com.sslexplorer.boot.CustomSocketFactory; 8 9 16 public class LocalForwardingChannel extends com.maverick.multiplex.channels.LocalForwardingChannel { 17 18 22 public LocalForwardingChannel() { 23 super(); 24 } 25 26 29 public byte[] open(byte[] data) throws IOException , ChannelOpenException{ 30 ByteArrayReader msg = new ByteArrayReader(data); 31 this.hostname = msg.readString(); 32 this.port = (int) msg.readInt(); 33 try { 34 this.socket = CustomSocketFactory.getDefault().createSocket(hostname, port); 35 } catch (IOException ioe) { 36 throw new ChannelOpenException(ChannelOpenException.CONNECT_FAILED, ioe.getMessage()); 37 } 38 return null; 39 } 40 41 } 42 | Popular Tags |