コード例 #1
0
        public TraditionalRequest(HttpWebRequest request)
        {
            Request    = request;
            RequestExt = DependencyInjector.GetExtension <HttpWebRequest, IHttpWebRequestExtension> (Request);

            RequestExt.SetKeepAlive(true);
        }
コード例 #2
0
        public TraditionalRequest(Uri uri)
        {
            Request    = (HttpWebRequest)HttpWebRequest.Create(uri);
            RequestExt = DependencyInjector.GetExtension <HttpWebRequest, IHttpWebRequestExtension> (Request);

            RequestExt.SetKeepAlive(true);
        }
コード例 #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)));
        }
コード例 #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);
        }
コード例 #5
0
            public override void SetProxy(IWebProxy proxy)
            {
                var clientExt = DependencyInjector.GetExtension <WebClient, IWebClientExtension> (Client);

                clientExt.SetProxy(proxy);
            }
コード例 #6
0
        public static IMonoTlsProviderExtensions GetTlsProviderExtension(this ConnectionProvider provider)
        {
            var tlsProvider = ((MonoConnectionProvider)provider).MonoTlsProvider;

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