Ejemplo n.º 1
0
 public Data(socks5.Socks.SocksRequest p, byte[] buffer, int count, DataType dtype)
 {
     Buffer = new byte[count];
     Array.Copy(buffer, Buffer, count);
     Request  = p;
     DataType = dtype;
 }
Ejemplo n.º 2
0
        public override socks5.TCP.Client OnConnectOverride(socks5.Socks.SocksRequest sr)
        {
            //use a socks5client to connect to it and passthru the data.
            //port 9050 is where torsocks is running (linux & windows)
            Socks5Client s = new Socks5Client(NKLISocksClient.Program.RemoteAddress_Socks, NKLISocksClient.Program.RemotePort_Socks, sr.Address, sr.Port, "un", "pw");

            if (s.Connect())
            {
                //connect synchronously to block the thread.
                return(s.Client);
            }
            else
            {
                Console.WriteLine("Failed!");
                return(null);
            }
        }
Ejemplo n.º 3
0
        public override socks5.TCP.Client OnConnectOverride(socks5.Socks.SocksRequest sr)
        {
            if (!IsGfwFucked(sr.Address))
            {
                return(null);
            }
            var            proxysock = new Socket(SocketType.Stream, ProtocolType.Tcp);
            HttpWebRequest httpreq   = HttpWebRequest.CreateHttp(sr.Address);
            WebProxy       wp        = httpreq.Proxy as WebProxy;

            wp.Address = new Uri(proxyurl);
            var response = httpreq.GetResponse();

            var client = new Client(new Socket(SocketType.Stream, ProtocolType.Tcp), 65535);


            return(client);
        }
Ejemplo n.º 4
0
 public override bool OnConnect(socks5.Socks.SocksRequest Request)
 {
     Console.WriteLine(Request.Port);
     return(true);
 }