Exemplo n.º 1
0
        public TraditionalRequest(HttpWebRequest request)
        {
            Request    = request;
            RequestExt = DependencyInjector.GetExtension <HttpWebRequest, IHttpWebRequestExtension> (Request);

            RequestExt.SetKeepAlive(true);
        }
Exemplo n.º 2
0
        public TraditionalRequest(Uri uri)
        {
            Request    = (HttpWebRequest)HttpWebRequest.Create(uri);
            RequestExt = DependencyInjector.GetExtension <HttpWebRequest, IHttpWebRequestExtension> (Request);

            RequestExt.SetKeepAlive(true);
        }
Exemplo n.º 3
0
        public void InvalidProxyScheme(TestContext ctx)
        {
            var url        = string.Format("https://{0}:8888/", address.Address);
            var request    = (HttpWebRequest)WebRequest.Create(url);
            var requestExt = DependencyInjector.GetExtension <HttpWebRequest, IHttpWebRequestExtension> (request);

            requestExt.SetProxy(ProxyServer.CreateSimpleProxy(new Uri(url)));
        }
Exemplo n.º 4
0
        static bool SupportsInstrumentation(ConnectionProvider provider)
        {
            var monoProvider = provider as MonoConnectionProvider;

            if (monoProvider == null)
            {
                return(false);
            }

            var tlsProvider = monoProvider.MonoTlsProvider;
            var extensions  = DependencyInjector.GetExtension <MonoTlsProvider, IMonoTlsProviderExtensions> (tlsProvider);

            return(extensions != null && extensions.SupportsInstrumentation);
        }
Exemplo n.º 5
0
            public override void SetProxy(IWebProxy proxy)
            {
                var clientExt = DependencyInjector.GetExtension <WebClient, IWebClientExtension> (Client);

                clientExt.SetProxy(proxy);
            }
Exemplo n.º 6
0
        public static IMonoTlsProviderExtensions GetTlsProviderExtension(this ConnectionProvider provider)
        {
            var tlsProvider = ((MonoConnectionProvider)provider).MonoTlsProvider;

            return(DependencyInjector.GetExtension <MonoTlsProvider, IMonoTlsProviderExtensions> (tlsProvider));
        }