Ejemplo n.º 1
0
 public void RunImpl()
 {
     _riverServer = new RiverServer(Settings.Default.Port, Settings.Default.Bypass);
     if (Settings.Default.SocksPort > 0)
     {
         _proxyServer = new SocksProxyServer(Settings.Default.SocksPort);
     }
 }
Ejemplo n.º 2
0
 public void Should_take_data_from_test_server_via_proxy5_on_river_socks_server()
 {
     using (var server = new SocksProxyServer(4548))
     {
         using (var socks = new Socks5Client())
         {
             socks.Connect("localhost", 4548, "httpbin.org", 80, true);
             TestConnction(socks);
         }
     }
 }
Ejemplo n.º 3
0
        public void Should_compare_direct_and_proxy_response()
        {
            string direct;

            using (var cli = new TcpClient())
            {
                cli.Connect("httpbin.org", 80);
                direct = TestConnction(cli.GetStream());
                direct = Regex.Replace(direct, "(?im)^Date: .*$", "");
                File.WriteAllText(Path.GetTempFileName(), direct);
            }
            using (var server = new SocksProxyServer(4547))
            {
                using (var socks = new Socks4Client())
                {
                    socks.Connect("localhost", 4547, "httpbin.org", 80, true);
                    var proxifyed = TestConnction(socks);
                    proxifyed = Regex.Replace(proxifyed, "(?im)^Date: .*$", "");
                    File.WriteAllText(Path.GetTempFileName(), proxifyed);
                    Assert.AreEqual(direct, proxifyed);
                }
            }
        }