use of org.webpieces.httpclient11.api.HttpClient in project webpieces by deanhiller.
the class IntegGoogleHttps method createSocket.
public static HttpSocket createSocket(boolean isHttp, String host, int port) {
HttpClient client = createHttpClient();
HttpSocket socket;
if (isHttp)
socket = client.createHttpSocket(new SocketListener());
else {
ForTestSslClientEngineFactory sslFactory = new ForTestSslClientEngineFactory();
socket = client.createHttpsSocket(sslFactory.createSslEngine(host, port), new SocketListener());
}
return socket;
}
use of org.webpieces.httpclient11.api.HttpClient in project webpieces by deanhiller.
the class Http2to11ClientFactory method createHttpClient.
public static Http2Client createHttpClient(String id, ChannelManager mgr, MeterRegistry metrics, BufferPool pool, boolean optimizeForBufferPool) {
HttpParser parser = HttpParserFactory.createParser(id, metrics, pool, optimizeForBufferPool);
HttpClient client11 = HttpClientFactory.createHttpClient(id, mgr, parser);
return new Http2ClientProxy(client11);
}
use of org.webpieces.httpclient11.api.HttpClient in project webpieces by deanhiller.
the class IntegGoogleHttps method createHttpClient.
public static HttpClient createHttpClient() {
BufferPool pool2 = new TwoPools("pl", new SimpleMeterRegistry());
Executor executor2 = Executors.newFixedThreadPool(10, new NamedThreadFactory("clientThread"));
ChannelManagerFactory factory = ChannelManagerFactory.createFactory(Metrics.globalRegistry);
ChannelManager mgr = factory.createMultiThreadedChanMgr("client", pool2, new BackpressureConfig(), executor2);
HttpParser parser = HttpParserFactory.createParser("a", new SimpleMeterRegistry(), pool2);
HttpClient client = HttpClientFactory.createHttpClient("myClient", mgr, parser);
return client;
}
Aggregations