Class HttpClientConnector

    • Constructor Detail

      • HttpClientConnector

        public HttpClientConnector​(@NonNull
                                   java.net.InetSocketAddress proxyAddress,
                                   @NonNull
                                   java.net.InetSocketAddress remoteAddress)
        Creates a new HttpClientConnector. The connector supports anonymous proxy connections as well as Basic and Negotiate authentication.
        Parameters:
        proxyAddress - of the proxy server we're connecting to
        remoteAddress - of the target server to connect to
      • HttpClientConnector

        public HttpClientConnector​(@NonNull
                                   java.net.InetSocketAddress proxyAddress,
                                   @NonNull
                                   java.net.InetSocketAddress remoteAddress,
                                   java.lang.String proxyUser,
                                   char[] proxyPassword)
        Creates a new HttpClientConnector. The connector supports anonymous proxy connections as well as Basic and Negotiate authentication. If a user name and password are given, the connector tries pre-emptive Basic authentication.
        Parameters:
        proxyAddress - of the proxy server we're connecting to
        remoteAddress - of the target server to connect to
        proxyUser - to authenticate at the proxy with
        proxyPassword - to authenticate at the proxy with
    • Method Detail

      • close

        private void close()
      • sendClientProxyMetadata

        public void sendClientProxyMetadata​(org.apache.sshd.client.session.ClientSession sshSession)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • send

        private void send​(java.lang.StringBuilder msg,
                          org.apache.sshd.common.io.IoSession session)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • connect

        private java.lang.StringBuilder connect()
      • authenticate

        private java.lang.StringBuilder authenticate​(java.lang.StringBuilder msg,
                                                     java.lang.String token)
      • eol

        private java.lang.StringBuilder eol​(java.lang.StringBuilder msg)
      • messageReceived

        public void messageReceived​(org.apache.sshd.common.io.IoSession session,
                                    org.apache.sshd.common.util.Readable buffer)
                             throws java.lang.Exception
        Description copied from interface: StatefulProxyConnector
        Handle a received message.
        Parameters:
        session - to use for writing data
        buffer - received data
        Throws:
        java.lang.Exception - if data cannot be read, or the connection attempt fails
      • handleMessage

        private void handleMessage​(org.apache.sshd.common.io.IoSession session,
                                   java.util.List<java.lang.String> reply)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception