code: @Override
      public void handleResponse(final HttpProxyResponse response)
              throws ProxyAuthException {
          if (!isHandshakeComplete()
                  && ("close".equalsIgnoreCase(StringUtilities
                          .getSingleValuedHeader(response.getHeaders(),
                                  "Proxy-Connection")) || "close"
                          .equalsIgnoreCase(StringUtilities
                                  .getSingleValuedHeader(response.getHeaders(),
                                          "Connection")))) {
              getProxyIoSession().setReconnectionNeeded(true);
          }
  
          if (response.getStatusCode() == 407) {
              if (authHandler == null) {
                  autoSelectAuthHandler(response);
              }
              authHandler.handleResponse(response);
          } else {
              throw new ProxyAuthException("Error: unexpected response code "
                      + response.getStatusLine() + " received from proxy.");
          }
      }
docs: Handle a HTTP response from the proxy server.
  
  @param response The proxy response.