public class HttpTunnelConnection extends Object implements TunnelConnection
TunnelConnection
implementation that uses HTTP to transfer data.TunnelClient
,
HttpTunnelServer
Modifier and Type | Class and Description |
---|---|
protected class |
HttpTunnelConnection.TunnelChannel
A
WritableByteChannel used to transfer traffic. |
Modifier | Constructor and Description |
---|---|
|
HttpTunnelConnection(String url,
ClientHttpRequestFactory requestFactory)
Create a new
HttpTunnelConnection instance. |
protected |
HttpTunnelConnection(String url,
ClientHttpRequestFactory requestFactory,
Executor executor)
Create a new
HttpTunnelConnection instance. |
Modifier and Type | Method and Description |
---|---|
protected ClientHttpRequest |
createRequest(boolean hasPayload) |
HttpTunnelConnection.TunnelChannel |
open(WritableByteChannel incomingChannel,
Closeable closeable)
Open the tunnel connection.
|
public HttpTunnelConnection(String url, ClientHttpRequestFactory requestFactory)
HttpTunnelConnection
instance.url
- the URL to connect torequestFactory
- the HTTP request factoryprotected HttpTunnelConnection(String url, ClientHttpRequestFactory requestFactory, Executor executor)
HttpTunnelConnection
instance.url
- the URL to connect torequestFactory
- the HTTP request factoryexecutor
- the executor used to handle connectionspublic HttpTunnelConnection.TunnelChannel open(WritableByteChannel incomingChannel, Closeable closeable) throws Exception
TunnelConnection
open
in interface TunnelConnection
incomingChannel
- a WritableByteChannel
that should be used to write
any incoming data received from the remote servercloseable
- a closeable to call when the channel is closedWritableByteChannel
that should be used to send any outgoing data
destined for the remote serverException
- in case of errorsprotected final ClientHttpRequest createRequest(boolean hasPayload) throws IOException
IOException
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.