code: private static int findVersion(final ByteBuf buffer) {
          final int n = buffer.readableBytes();
          // per spec, the version number is found in the 13th byte
          if (n < 13) {
              return -1;
          }
  
          int idx = buffer.readerIndex();
          return match(BINARY_PREFIX, buffer, idx) ? buffer.getByte(idx + BINARY_PREFIX_LENGTH) : 1;
      }
docs: Returns the proxy protocol specification version in the buffer if the version is found.
  Returns -1 if no version was found in the buffer.