code: protected HttpProxyResponse decodeResponse(final String response)
              throws Exception {
          LOGGER.debug("  parseResponse()");
  
          // Break response into lines
          String[] responseLines = response.split(HttpProxyConstants.CRLF);
  
          // Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
          // BUG FIX : Trimed to prevent failures with some proxies that add 
          // extra space chars like "Microsoft-IIS/5.0" ...
          String[] statusLine = responseLines[0].trim().split(" ", 2);
  
          if (statusLine.length < 2) {
              throw new Exception("Invalid response status line (" + statusLine
                      + "). Response: " + response);
          }
  
          // Status code is 3 digits
          if (statusLine[1].matches("^\\d\\d\\d")) {
              throw new Exception("Invalid response code (" + statusLine[1]
                      + "). Response: " + response);
          }
  
          Map<String, List<String>> headers = new HashMap<>();
  
          for (int i = 1; i < responseLines.length; i++) {
              String[] args = responseLines[i].split(":\\s?", 2);
              StringUtilities.addValueToHeader(headers, args[0], args[1], false);
          }
  
          return new HttpProxyResponse(statusLine[0], statusLine[1], headers);
      }
docs: Parse a HTTP response from the proxy server.
  
  @param response The response string.