public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
SPDYProxyEngine
implements a SPDY to SPDY proxy, that is, converts SPDY events received by clients into
SPDY events for the servers.
StreamFrameListener.Adapter
Constructor and Description |
---|
SPDYProxyEngine(SPDYClient.Factory factory) |
Modifier and Type | Method and Description |
---|---|
long |
getConnectTimeout() |
long |
getTimeout() |
void |
onData(Stream clientStream,
DataInfo clientDataInfo)
Callback invoked when data bytes are received on a stream.
|
void |
onFailure(Stream stream,
Throwable x)
Callback invoked on errors.
|
void |
onHeaders(Stream stream,
HeadersInfo headersInfo)
Callback invoked when headers are received on a stream.
|
StreamFrameListener |
onPush(Stream stream,
PushInfo pushInfo)
Callback invoked when a push syn has been received on a stream.
|
void |
onReply(Stream stream,
ReplyInfo replyInfo)
Callback invoked when a reply to a stream creation has been received.
|
StreamFrameListener |
proxy(Stream clientStream,
SynInfo clientSynInfo,
ProxyEngineSelector.ProxyServerInfo proxyServerInfo) |
void |
setConnectTimeout(long connectTimeout) |
void |
setTimeout(long timeout) |
addRequestProxyHeaders, addResponseProxyHeaders, customizeRequestHeaders, customizeResponseHeaders, getName, removeHopHeaders
public SPDYProxyEngine(SPDYClient.Factory factory)
public long getConnectTimeout()
public void setConnectTimeout(long connectTimeout)
public long getTimeout()
public void setTimeout(long timeout)
public StreamFrameListener proxy(Stream clientStream, SynInfo clientSynInfo, ProxyEngineSelector.ProxyServerInfo proxyServerInfo)
proxy
in class ProxyEngine
public StreamFrameListener onPush(Stream stream, PushInfo pushInfo)
StreamFrameListener
Callback invoked when a push syn has been received on a stream.
onPush
in interface StreamFrameListener
stream
- the push stream just createdpushInfo
- the push metadatapublic void onReply(Stream stream, ReplyInfo replyInfo)
StreamFrameListener
Callback invoked when a reply to a stream creation has been received.
Application code may implement this method to send more data to the other end:
public void onReply(Stream stream, ReplyInfo replyInfo) { stream.data(new StringDataInfo("content"), true); }
onReply
in interface StreamFrameListener
stream
- the streamreplyInfo
- the reply metadatapublic void onHeaders(Stream stream, HeadersInfo headersInfo)
StreamFrameListener
Callback invoked when headers are received on a stream.
onHeaders
in interface StreamFrameListener
stream
- the streamheadersInfo
- the headers metadatapublic void onData(Stream clientStream, DataInfo clientDataInfo)
StreamFrameListener
Callback invoked when data bytes are received on a stream.
Implementers should be read or consume the content of the
DataInfo
before this method returns.
onData
in interface StreamFrameListener
clientStream
- the streamclientDataInfo
- the data metadatapublic void onFailure(Stream stream, Throwable x)
StreamFrameListener
Callback invoked on errors.
onFailure
in interface StreamFrameListener
stream
- the streamx
- the failureCopyright © 1995-2015 Webtide. All Rights Reserved.