@Override protected BasicHttpProcessor createHttpProcessor() { BasicHttpProcessor httpproc = new BasicHttpProcessor(); httpproc.addInterceptor(new RequestDefaultHeaders()); // Required protocol interceptors httpproc.addInterceptor(new RequestContent()); httpproc.addInterceptor(new RequestTargetHost()); // Recommended protocol interceptors httpproc.addInterceptor(new RequestConnControl()); httpproc.addInterceptor(new RequestUserAgent()); httpproc.addInterceptor(new RequestExpectContinue()); // HTTP state management interceptors httpproc.addInterceptor(new RequestAddCookies()); httpproc.addInterceptor(new ResponseProcessCookies()); // HTTP authentication interceptors httpproc.addInterceptor(new RequestTargetAuthentication()); httpproc.addInterceptor(new RequestProxyAuthentication()); return httpproc; }
t.start(); HttpProcessor httpProcessor = new ImmutableHttpProcessor(new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(), new RequestExpectContinue(false)); requester = new HttpAsyncRequester(httpProcessor, new DefaultConnectionReuseStrategy());
public BenchmarkWorker( final HttpRequest request, final HttpHost targetHost, final SocketFactory socketFactory, final Config config) { super(); this.context = new HttpCoreContext(); this.request = request; this.targetHost = targetHost; this.config = config; this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent("HttpCore-AB/1.1"), new RequestExpectContinue(this.config.isUseExpectContinue())); this.httpexecutor = new HttpRequestExecutor(); this.connstrategy = DefaultConnectionReuseStrategy.INSTANCE; this.socketFactory = socketFactory; }
public TargetConfiguration(ConfigurationContext configurationContext, ParameterInclude parameters, WorkerPool pool, PassThroughTransportMetricsCollector metrics, ProxyAuthenticator proxyAuthenticator) { super(configurationContext, parameters, pool, metrics); httpProcessor = new ImmutableHttpProcessor( new HttpRequestInterceptor[] { new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(), new RequestExpectContinue() }); this.connectionTimeoutConfiguration = new ConnectionTimeoutConfiguration(conf.getConnectionIdleTime(), conf.getMaximumConnectionLifespan()); this.proxyAuthenticator = proxyAuthenticator; }
private void registerURLS() { final HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {new RequestExpectContinue()}, new HttpResponseInterceptor[] {new ResponseDate(), new ResponseServer(), new ResponseContent(), new ResponseConnControl()}); final HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry(); reqistry.register(getRegisteredURLs(), new SentiloRequestHandler(handlerLocator, authenticationService)); httpService = new HttpService(httpproc, new DefaultConnectionReuseStrategy(), new DefaultHttpResponseFactory(), reqistry, params); }
/** * Return the HttpProcessor for requests * * @return the HttpProcessor that processes requests */ private HttpProcessor getHttpProcessor() { BasicHttpProcessor httpProcessor = new BasicHttpProcessor(); httpProcessor.addInterceptor(new RequestContent()); httpProcessor.addInterceptor(new RequestTargetHost()); httpProcessor.addInterceptor(new RequestConnControl()); httpProcessor.addInterceptor(new RequestUserAgent()); httpProcessor.addInterceptor(new RequestExpectContinue()); return httpProcessor; }
public RequestListenerThread(final int port) throws IOException { logger.info("Starting proxy listener thread on " + port); this.serversocket = new ServerSocket(port); // Set up HTTP protocol processor for incoming connections final HttpProcessor inhttpproc = new ImmutableHttpProcessor( new ResponseDate(), new ResponseServer("Test/1.1"), new ResponseContent(), new ResponseConnControl()); // Set up HTTP protocol processor for outgoing connections final HttpProcessor outhttpproc = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent("Test/1.1"), new RequestExpectContinue(true)); // Set up outgoing request executor final HttpRequestExecutor httpexecutor = new HttpRequestExecutor(); // Set up incoming request handler final UriHttpRequestHandlerMapper reqistry = new UriHttpRequestHandlerMapper(); reqistry.register("*", new ProxyHandler( outhttpproc, httpexecutor)); // Set up the HTTP service (the listener) this.httpService = new HttpService(inhttpproc, reqistry); }
public BenchmarkWorker( final HttpParams params, int verbosity, final RequestGenerator requestGenerator, final HttpHost targetHost, int count, boolean keepalive) { super(); this.params = params; this.requestGenerator = requestGenerator; this.context = new BasicHttpContext(null); this.targetHost = targetHost; this.count = count; this.keepalive = keepalive; this.httpProcessor = new BasicHttpProcessor(); this.httpexecutor = new HttpRequestExecutor(); // Required request interceptors this.httpProcessor.addInterceptor(new RequestContent()); this.httpProcessor.addInterceptor(new RequestTargetHost()); // Recommended request interceptors this.httpProcessor.addInterceptor(new RequestConnControl()); this.httpProcessor.addInterceptor(new RequestUserAgent()); this.httpProcessor.addInterceptor(new RequestExpectContinue()); this.connstrategy = new DefaultConnectionReuseStrategy(); this.verbosity = verbosity; }
.add(new CustomRequestConnControl(shouldClose)) .add(new RequestUserAgent("JCBC/1.2")) .add(new RequestExpectContinue(true)).build();
processor.addInterceptor(new RequestConnControl()); processor.addInterceptor(new RequestUserAgent()); processor.addInterceptor(new RequestExpectContinue());
httpproc.addInterceptor(new RequestConnControl()); httpproc.addInterceptor(new RequestUserAgent()); httpproc.addInterceptor(new RequestExpectContinue()); BufferingHttpClientHandler handler = new BufferingHttpClientHandler( httpproc,
public BrainClient() { // note: constructor will fail if any of these properties are not defined String serverName; int serverPort; String graph; Service config = SemanticSynchrony.getConfiguration().getServices().getServer(); serverName = config.getHost(); serverPort = config.getPort(); graph = config.getGraph(); baseUrl = "/graphs/" + graph + "/smsn/"; httpProcessor = HttpProcessorBuilder.create() .add(new RequestContent()) .add(new RequestTargetHost()) .add(new RequestConnControl()) // TODO //.add(new RequestUserAgent(agentName)) .add(new RequestUserAgent()) .add(new RequestExpectContinue()).build(); httpExecutor = new HttpRequestExecutor(); httpContext = HttpCoreContext.create(); httpHost = new HttpHost(serverName, serverPort); httpContext.setTargetHost(httpHost); }
@Override protected BasicHttpProcessor createHttpProcessor() { BasicHttpProcessor httpproc = new BasicHttpProcessor(); httpproc.addInterceptor(new RequestDefaultHeaders()); // Required protocol interceptors httpproc.addInterceptor(new RequestContent()); httpproc.addInterceptor(new RequestTargetHost()); // Recommended protocol interceptors httpproc.addInterceptor(new RequestConnControl()); httpproc.addInterceptor(new RequestUserAgent()); httpproc.addInterceptor(new RequestExpectContinue()); // HTTP state management interceptors httpproc.addInterceptor(new RequestAddCookies()); httpproc.addInterceptor(new ResponseProcessCookies()); // HTTP authentication interceptors httpproc.addInterceptor(new RequestTargetAuthentication()); httpproc.addInterceptor(new RequestProxyAuthentication()); return httpproc; }
@Override protected BasicHttpProcessor createHttpProcessor() { BasicHttpProcessor httpproc = new BasicHttpProcessor(); httpproc.addInterceptor(new RequestDefaultHeaders()); // Required protocol interceptors httpproc.addInterceptor(new RequestContent()); httpproc.addInterceptor(new RequestTargetHost()); // Recommended protocol interceptors httpproc.addInterceptor(new RequestConnControl()); httpproc.addInterceptor(new RequestUserAgent()); httpproc.addInterceptor(new RequestExpectContinue()); // HTTP state management interceptors httpproc.addInterceptor(new RequestAddCookies()); httpproc.addInterceptor(new ResponseProcessCookies()); // HTTP authentication interceptors httpproc.addInterceptor(new RequestTargetAuthentication()); httpproc.addInterceptor(new RequestProxyAuthentication()); return httpproc; }
@Override protected BasicHttpProcessor createHttpProcessor() { BasicHttpProcessor httpproc = new BasicHttpProcessor(); httpproc.addInterceptor(new RequestDefaultHeaders()); // Required protocol interceptors httpproc.addInterceptor(new RequestContent()); httpproc.addInterceptor(new RequestTargetHost()); // Recommended protocol interceptors httpproc.addInterceptor(new RequestConnControl()); httpproc.addInterceptor(new RequestUserAgent()); httpproc.addInterceptor(new RequestExpectContinue()); // HTTP state management interceptors httpproc.addInterceptor(new RequestAddCookies()); httpproc.addInterceptor(new ResponseProcessCookies()); // HTTP authentication interceptors httpproc.addInterceptor(new RequestTargetAuthentication()); httpproc.addInterceptor(new RequestProxyAuthentication()); return httpproc; }
@Override protected BasicHttpProcessor createHttpProcessor() { BasicHttpProcessor httpproc = new BasicHttpProcessor(); httpproc.addInterceptor(new RequestDefaultHeaders()); // Required protocol interceptors httpproc.addInterceptor(new RequestContent()); httpproc.addInterceptor(new RequestTargetHost()); // Recommended protocol interceptors httpproc.addInterceptor(new RequestConnControl()); httpproc.addInterceptor(new RequestUserAgent()); httpproc.addInterceptor(new RequestExpectContinue()); // HTTP state management interceptors httpproc.addInterceptor(new RequestAddCookies()); httpproc.addInterceptor(new ResponseProcessCookies()); // HTTP authentication interceptors httpproc.addInterceptor(new RequestTargetAuthentication()); httpproc.addInterceptor(new RequestProxyAuthentication()); return httpproc; }
httpproc.addInterceptor(new RequestExpectContinue());
httpproc.addInterceptor(new RequestExpectContinue());
httpproc.addInterceptor(new RequestExpectContinue());
httpproc.addInterceptor(new RequestExpectContinue());