use of org.webpieces.httpclient11.api.HttpSocket in project webpieces by deanhiller.
the class DirectHttp11Client method createHttpSocket.
public HttpSocket createHttpSocket(HttpSocketListener closeListener) {
ConnectionListener listener = mgr.getHttpConnection();
MockTcpChannel channel = new MockTcpChannel(false);
return new HttpSocketImpl(new DelayedProxy(listener, channel), parser, closeListener, false);
// return new Http11SocketImpl(listener, channel, parser, false);
}
use of org.webpieces.httpclient11.api.HttpSocket in project webpieces by deanhiller.
the class Http2ClientProxy method createHttpSocket.
@Override
public Http2Socket createHttpSocket(Http2SocketListener listener) {
Http11CloseListener http11Listener = new Http11CloseListener(listener);
HttpSocket socket11 = client11.createHttpSocket(http11Listener);
Http2SocketImpl http2Socket = new Http2SocketImpl(socket11);
http11Listener.setHttp2Socket(http2Socket);
return http2Socket;
}
use of org.webpieces.httpclient11.api.HttpSocket in project webpieces by deanhiller.
the class DirectHttp11Client method createHttpsSocket.
public HttpSocket createHttpsSocket(SSLEngine engine, HttpSocketListener closeListener) {
ConnectionListener listener = mgr.getHttpsConnection();
MockTcpChannel channel = new MockTcpChannel(true);
return new HttpSocketImpl(new DelayedProxy(listener, channel), parser, closeListener, true);
}
use of org.webpieces.httpclient11.api.HttpSocket in project webpieces by deanhiller.
the class AbstractWebpiecesTest method connectHttp.
// public HttpSocket connectHttpLocal() {
// try {
// return connectHttp(false, null);
// } catch (InterruptedException | ExecutionException | TimeoutException e) {
// throw SneakyThrow.sneak(e);
// }
// }
//
// public HttpSocket connectHttpsLocal() {
// try {
// return connectHttps(false, null, null);
// } catch (InterruptedException | ExecutionException | TimeoutException e) {
// throw SneakyThrow.sneak(e);
// }
// }
/**
* @deprecated Use connectHttp with no isRemote parameter AND override isRemote() IF you need
*/
@Deprecated
public HttpSocket connectHttp(boolean isRemote, InetSocketAddress addr) throws InterruptedException, ExecutionException, TimeoutException {
NullHttp1CloseListener listener = new NullHttp1CloseListener();
HttpSocket socket = getClient(isRemote).createHttpSocket(listener);
XFuture<Void> connect = socket.connect(addr);
connect.get(2, TimeUnit.SECONDS);
return socket;
}
use of org.webpieces.httpclient11.api.HttpSocket in project webpieces by deanhiller.
the class AbstractWebpiecesTest method connectHttps.
/**
* @deprecated Use connectHttp with no isRemote parameter AND override isRemote() IF you need
*/
@Deprecated
public HttpSocket connectHttps(boolean isRemote, SSLEngine engine, InetSocketAddress addr) throws InterruptedException, ExecutionException, TimeoutException {
NullHttp1CloseListener listener = new NullHttp1CloseListener();
HttpSocket socket = getClient(isRemote).createHttpsSocket(engine, listener);
XFuture<Void> connect = socket.connect(addr);
connect.get(2, TimeUnit.SECONDS);
return socket;
}
Aggregations