Package org.littleshoot.proxy
Interface ChainedProxy
-
- All Superinterfaces:
SslEngineSource
- All Known Implementing Classes:
ChainedProxyAdapter
public interface ChainedProxy extends SslEngineSource
Encapsulates information needed to connect to a chained proxy.
Sub-classes may wish to extend
ChainedProxyAdapterfor sensible defaults.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconnectionFailed(Throwable cause)Called to let us know that connecting to this proxy failed.voidconnectionSucceeded()Called to let us know that connecting to this proxy succeeded.voiddisconnected()Called to let us know that we were disconnected.voidfilterRequest(HttpObject httpObject)Filters requests on their way to the chained proxy.InetSocketAddressgetChainedProxyAddress()Return theInetSocketAddressfor connecting to the chained proxy.ChainedProxyTypegetChainedProxyType()Tell LittleProxy the type of chained proxy that it will be connecting to.InetSocketAddressgetLocalAddress()(Optional) ensure that the connection is opened from a specific local address (useful when doing NAT traversal).StringgetPassword()(Optional) implement this method if the chained proxy requires a password.TransportProtocolgetTransportProtocol()Tell LittleProxy what kind of TransportProtocol to use to communicate with the chained proxy.StringgetUsername()(Optional) implement this method if the chained proxy requires a username.booleanrequiresEncryption()Implement this method to tell LittleProxy whether to encrypt connections to the chained proxy for the given request.-
Methods inherited from interface org.littleshoot.proxy.SslEngineSource
newSslEngine, newSslEngine
-
-
-
-
Method Detail
-
getChainedProxyAddress
InetSocketAddress getChainedProxyAddress()
Return theInetSocketAddressfor connecting to the chained proxy. Returning null indicates that we won't chain.- Returns:
- The Chain Proxy with Host and Port.
-
getLocalAddress
InetSocketAddress getLocalAddress()
(Optional) ensure that the connection is opened from a specific local address (useful when doing NAT traversal).
-
getTransportProtocol
TransportProtocol getTransportProtocol()
Tell LittleProxy what kind of TransportProtocol to use to communicate with the chained proxy.
-
getChainedProxyType
ChainedProxyType getChainedProxyType()
Tell LittleProxy the type of chained proxy that it will be connecting to. This setting determines what type of requests LittleProxy will use to communicate with the chained proxy.- Returns:
- the chained proxy type.
-
getUsername
String getUsername()
(Optional) implement this method if the chained proxy requires a username.- Returns:
- the username to send to the chained proxy.
-
getPassword
String getPassword()
(Optional) implement this method if the chained proxy requires a password.- Returns:
- the password to send to the chained proxy.
-
requiresEncryption
boolean requiresEncryption()
Implement this method to tell LittleProxy whether to encrypt connections to the chained proxy for the given request. If true, LittleProxy will callSslEngineSource.newSslEngine()to obtain an SSLContext used by the downstream proxy.- Returns:
- true of the connection to the chained proxy should be encrypted
-
filterRequest
void filterRequest(HttpObject httpObject)
Filters requests on their way to the chained proxy.
-
connectionSucceeded
void connectionSucceeded()
Called to let us know that connecting to this proxy succeeded.
-
connectionFailed
void connectionFailed(Throwable cause)
Called to let us know that connecting to this proxy failed.- Parameters:
cause- exception that caused this failure (maybe null)
-
disconnected
void disconnected()
Called to let us know that we were disconnected.
-
-