public async Task TestSsl()
        {
            string testUrl = "https://google.com";

            using (var proxy = new ProxyTestController())
            {
                using (var client = TestHelper.CreateHttpClient(testUrl, proxy.ListeningPort))
                {
                    var response = await client.GetAsync(new Uri(testUrl));

                    Assert.IsNotNull(response);
                }
            }
        }
Exemple #2
0
        //[TestMethod]
        //disable this test until CI is prepared to handle
        public void TestSsl()
        {
            //expand this to stress test to find
            //why in long run proxy becomes unresponsive as per issue #184
            string testUrl   = "https://google.com";
            int    proxyPort = 8086;
            var    proxy     = new ProxyTestController();

            proxy.StartProxy(proxyPort);

            using (var client = CreateHttpClient(testUrl, proxyPort))
            {
                var response = client.GetAsync(new Uri(testUrl)).Result;
            }
        }
        public async Task Can_Intercept_Post_Requests()
        {
            string testUrl = "http://interceptthis.com";

            using (var proxy = new ProxyTestController())
            {
                using (var client = TestHelper.CreateHttpClient(testUrl, proxy.ListeningPort))
                {
                    var response = await client.PostAsync(new Uri(testUrl), new StringContent("hello!"));

                    Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);

                    var body = await response.Content.ReadAsStringAsync();

                    Assert.IsTrue(body.Contains("TitaniumWebProxy-Stopped!!"));
                }
            }
        }