code: private void addHttpBasicAuth(final ChannelHandlerContext ctx, final HttpRequest request) {
      ByteBuf raw = ctx.alloc().buffer(username.length() + password.length() + 1);
      raw.writeBytes((username + ":" + password).getBytes(CharsetUtil.UTF_8));
      ByteBuf encoded = Base64.encode(raw, false);
      request.headers().add(HttpHeaders.Names.AUTHORIZATION, "Basic " + encoded.toString(CharsetUtil.UTF_8));
      encoded.release();
      raw.release();
    }
docs: Helper method to add authentication credentials to the config stream request.