public class ChainedProxyAdapter extends Object implements ChainedProxy
ChainedProxy
.Modifier and Type | Field and Description |
---|---|
static ChainedProxy |
FALLBACK_TO_DIRECT_CONNECTION
ChainedProxy that simply has the downstream proxy make a direct
connection to the upstream server. |
Constructor and Description |
---|
ChainedProxyAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
connectionFailed(Throwable cause)
Called to let us know that connecting to this proxy failed.
|
void |
connectionSucceeded()
Called to let us know that connecting to this proxy succeeded.
|
void |
disconnected()
Called to let us know that we were disconnected.
|
void |
filterRequest(io.netty.handler.codec.http.HttpObject httpObject)
Filters requests on their way to the chained proxy.
|
InetSocketAddress |
getChainedProxyAddress()
Return the
InetSocketAddress for connecting to the chained proxy. |
InetSocketAddress |
getLocalAddress()
(Optional) ensure that the connection is opened from a specific local
address (useful when doing NAT traversal).
|
TransportProtocol |
getTransportProtocol()
Tell LittleProxy what kind of TransportProtocol to use to communicate
with the chained proxy.
|
SSLEngine |
newSslEngine()
Returns an
SSLEngine to use for a server connection from
LittleProxy to the client. |
SSLEngine |
newSslEngine(String peerHost,
int peerPort)
Returns an
SSLEngine to use for a client connection from
LittleProxy to the upstream server. |
boolean |
requiresEncryption()
Implement this method to tell LittleProxy whether or not to encrypt
connections to the chained proxy for the given request.
|
public static ChainedProxy FALLBACK_TO_DIRECT_CONNECTION
ChainedProxy
that simply has the downstream proxy make a direct
connection to the upstream server.public InetSocketAddress getChainedProxyAddress()
ChainedProxy
InetSocketAddress
for connecting to the chained proxy.
Returning null indicates that we won't chain.getChainedProxyAddress
in interface ChainedProxy
public InetSocketAddress getLocalAddress()
ChainedProxy
getLocalAddress
in interface ChainedProxy
public TransportProtocol getTransportProtocol()
ChainedProxy
getTransportProtocol
in interface ChainedProxy
public boolean requiresEncryption()
ChainedProxy
SslEngineSource.newSslEngine()
to obtain an
SSLContext used by the downstream proxy.requiresEncryption
in interface ChainedProxy
public SSLEngine newSslEngine()
SslEngineSource
SSLEngine
to use for a server connection from
LittleProxy to the client.newSslEngine
in interface SslEngineSource
public void filterRequest(io.netty.handler.codec.http.HttpObject httpObject)
ChainedProxy
filterRequest
in interface ChainedProxy
public void connectionSucceeded()
ChainedProxy
connectionSucceeded
in interface ChainedProxy
public void connectionFailed(Throwable cause)
ChainedProxy
connectionFailed
in interface ChainedProxy
cause
- exception that caused this failure (may be null)public void disconnected()
ChainedProxy
disconnected
in interface ChainedProxy
public SSLEngine newSslEngine(String peerHost, int peerPort)
SslEngineSource
SSLEngine
to use for a client connection from
LittleProxy to the upstream server. *
Note: Peer information is needed to send the server_name extension in
handshake with Server Name Indication (SNI).newSslEngine
in interface SslEngineSource
peerHost
- to start a client connection to the server.peerPort
- to start a client connection to the server.Copyright © 2009–2018 LittleShoot. All rights reserved.