public TraditionalRequest(HttpWebRequest request) { Request = request; RequestExt = DependencyInjector.GetExtension <HttpWebRequest, IHttpWebRequestExtension> (Request); RequestExt.SetKeepAlive(true); }
public TraditionalRequest(Uri uri) { Request = (HttpWebRequest)HttpWebRequest.Create(uri); RequestExt = DependencyInjector.GetExtension <HttpWebRequest, IHttpWebRequestExtension> (Request); RequestExt.SetKeepAlive(true); }
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))); }
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); }
public override void SetProxy(IWebProxy proxy) { var clientExt = DependencyInjector.GetExtension <WebClient, IWebClientExtension> (Client); clientExt.SetProxy(proxy); }
public static IMonoTlsProviderExtensions GetTlsProviderExtension(this ConnectionProvider provider) { var tlsProvider = ((MonoConnectionProvider)provider).MonoTlsProvider; return(DependencyInjector.GetExtension <MonoTlsProvider, IMonoTlsProviderExtensions> (tlsProvider)); }