code: static HAProxyMessage decodeHeader(String header) {
          if (header == null) {
              throw new HAProxyProtocolException("header");
          }
  
          String[] parts = header.split(" ");
          int numParts = parts.length;
  
          if (numParts < 2) {
              throw new HAProxyProtocolException(
                      "invalid header: " + header + " (expected: 'PROXY' and proxied protocol values)");
          }
  
          if (!"PROXY".equals(parts[0])) {
              throw new HAProxyProtocolException("unknown identifier: " + parts[0]);
          }
  
          HAProxyProxiedProtocol protAndFam;
          try {
              protAndFam = HAProxyProxiedProtocol.valueOf(parts[1]);
          } catch (IllegalArgumentException e) {
              throw new HAProxyProtocolException(e);
          }
  
          if (protAndFam != HAProxyProxiedProtocol.TCP4 &&
                  protAndFam != HAProxyProxiedProtocol.TCP6 &&
                  protAndFam != HAProxyProxiedProtocol.UNKNOWN) {
              throw new HAProxyProtocolException("unsupported v1 proxied protocol: " + parts[1]);
          }
  
          if (protAndFam == HAProxyProxiedProtocol.UNKNOWN) {
              return V1_UNKNOWN_MSG;
          }
  
          if (numParts != 6) {
              throw new HAProxyProtocolException("invalid TCP4/6 header: " + header + " (expected: 6 parts)");
          }
  
          return new HAProxyMessage(
                  HAProxyProtocolVersion.V1, HAProxyCommand.PROXY,
                  protAndFam, parts[2], parts[3], parts[4], parts[5]);
      }
docs: Decodes a version 1, human-readable proxy protocol header.
  
  @param header                     a version 1 proxy protocol header
  @return                           {@link HAProxyMessage} instance
  @throws HAProxyProtocolException  if any portion of the header is invalid