Пример #1
0
        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));
 }
Пример #4
0
 public byte[] ReadR()
 {
     return(pipeR2L.ReadByte());
 }
Пример #5
0
 public byte[] ReadL()
 {
     return(pipeL2R.ReadByte());
 }