Class ChainedProxyAdapter

    • Field Detail

      • FALLBACK_TO_DIRECT_CONNECTION

        public static ChainedProxy FALLBACK_TO_DIRECT_CONNECTION
        ChainedProxy that simply has the downstream proxy make a direct connection to the upstream server.
    • Constructor Detail

      • ChainedProxyAdapter

        public ChainedProxyAdapter()
    • Method Detail

      • getLocalAddress

        public InetSocketAddress getLocalAddress()
        Description copied from interface: ChainedProxy
        (Optional) ensure that the connection is opened from a specific local address (useful when doing NAT traversal).
        Specified by:
        getLocalAddress in interface ChainedProxy
      • getChainedProxyType

        public ChainedProxyType getChainedProxyType()
        Description copied from interface: ChainedProxy
        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.
        Specified by:
        getChainedProxyType in interface ChainedProxy
        Returns:
        the chained proxy type.
      • getUsername

        public String getUsername()
        Description copied from interface: ChainedProxy
        (Optional) implement this method if the chained proxy requires a username.
        Specified by:
        getUsername in interface ChainedProxy
        Returns:
        the username to send to the chained proxy.
      • getPassword

        public String getPassword()
        Description copied from interface: ChainedProxy
        (Optional) implement this method if the chained proxy requires a password.
        Specified by:
        getPassword in interface ChainedProxy
        Returns:
        the password to send to the chained proxy.
      • requiresEncryption

        public boolean requiresEncryption()
        Description copied from interface: ChainedProxy
        Implement this method to tell LittleProxy whether to encrypt connections to the chained proxy for the given request. If true, LittleProxy will call SslEngineSource.newSslEngine() to obtain an SSLContext used by the downstream proxy.
        Specified by:
        requiresEncryption in interface ChainedProxy
        Returns:
        true of the connection to the chained proxy should be encrypted
      • connectionSucceeded

        public void connectionSucceeded()
        Description copied from interface: ChainedProxy
        Called to let us know that connecting to this proxy succeeded.
        Specified by:
        connectionSucceeded in interface ChainedProxy
      • connectionFailed

        public void connectionFailed​(Throwable cause)
        Description copied from interface: ChainedProxy
        Called to let us know that connecting to this proxy failed.
        Specified by:
        connectionFailed in interface ChainedProxy
        Parameters:
        cause - exception that caused this failure (maybe null)
      • disconnected

        public void disconnected()
        Description copied from interface: ChainedProxy
        Called to let us know that we were disconnected.
        Specified by:
        disconnected in interface ChainedProxy
      • newSslEngine

        public SSLEngine newSslEngine​(String peerHost,
                                      int peerPort)
        Description copied from interface: SslEngineSource
        Returns an 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).
        Specified by:
        newSslEngine in interface SslEngineSource
        Parameters:
        peerHost - to start a client connection to the server.
        peerPort - to start a client connection to the server.