protected override bool WorkFlow(Pipe pipeClient2Server, Pipe pipeServer2Client) { bool result = false; byte[] request = pipeClient2Server.ReadByte(); if (request != null) { int version = request[0]; // check if is socks version 5 if (version == '\u0005') { string reply = "\u0005\u0000"; pipeServer2Client.Write(reply); request = pipeClient2Server.ReadByte(); if (request != null) { CMDType cmdType = (CMDType)request[1]; if (cmdType == CMDType.Connect) { result = HandleTCPReq(request, pipeServer2Client, pipeClient2Server); } else if (cmdType == CMDType.Udp) { // result = HandleUDPReq(request, pipeServer2Client, pipeClient2Server); } } } } return(result); }
public int ReadR(ByteBuffer buffer) { return(pipeR2L.ReadByte(buffer)); }
public int ReadL(ByteBuffer buffer) { return(pipeL2R.ReadByte(buffer)); }
public byte[] ReadR() { return(pipeR2L.ReadByte()); }
public byte[] ReadL() { return(pipeL2R.ReadByte()); }