Class ProxyHandshaker


  • class ProxyHandshaker
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String mHost  
      private int mPort  
      private ProxySettings mSettings  
      private static java.lang.String RN  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addHeaders​(java.lang.StringBuilder builder)  
      private void addProxyAuthorization​(java.lang.StringBuilder builder)  
      private java.lang.String buildRequest()  
      (package private) java.lang.String getProxiedHostname()
      To be able to verify the hostname of the certificate received if a connection is made to an https/wss endpoint, access to this hostname is required.
      void perform​(java.net.Socket socket)  
      private void readStatusLine​(java.io.InputStream input)  
      private void receiveResponse​(java.net.Socket socket)  
      private void sendRequest​(java.net.Socket socket)  
      private void skipHeaders​(java.io.InputStream input)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mHost

        private final java.lang.String mHost
      • mPort

        private final int mPort
    • Constructor Detail

      • ProxyHandshaker

        public ProxyHandshaker​(java.lang.String host,
                               int port,
                               ProxySettings settings)
    • Method Detail

      • perform

        public void perform​(java.net.Socket socket)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • sendRequest

        private void sendRequest​(java.net.Socket socket)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • buildRequest

        private java.lang.String buildRequest()
      • addHeaders

        private void addHeaders​(java.lang.StringBuilder builder)
      • addProxyAuthorization

        private void addProxyAuthorization​(java.lang.StringBuilder builder)
      • receiveResponse

        private void receiveResponse​(java.net.Socket socket)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readStatusLine

        private void readStatusLine​(java.io.InputStream input)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • skipHeaders

        private void skipHeaders​(java.io.InputStream input)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getProxiedHostname

        java.lang.String getProxiedHostname()
        To be able to verify the hostname of the certificate received if a connection is made to an https/wss endpoint, access to this hostname is required.
        Returns:
        the hostname of the server the proxy is asked to connect to.