Skip to content

Commit dfe7f25

Browse files
committed
Update doc related with HTTP/2
Signed-off-by: raccoonback <[email protected]>
1 parent 0e59863 commit dfe7f25

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/modules/ROOT/pages/http-client.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ include::{examples-dir}/http2/H2Application.java[lines=18..42]
318318
----
319319
<1> Configures the client to support only `HTTP/2`
320320
<2> Configures `SSL`
321+
<3> You can configure the interval for checking `Ping` frames
321322

322323
The following listing presents a simple `H2C` example:
323324

reactor-netty-examples/src/main/java/reactor/netty/examples/documentation/http/client/http2/H2Application.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved.
2+
* Copyright (c) 2020-2025 VMware, Inc. or its affiliates, All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,13 +21,16 @@
2121
import reactor.netty.http.client.HttpClient;
2222
import reactor.util.function.Tuple2;
2323

24+
import java.time.Duration;
25+
2426
public class H2Application {
2527

2628
public static void main(String[] args) {
2729
HttpClient client =
2830
HttpClient.create()
2931
.protocol(HttpProtocol.H2) //<1>
30-
.secure(); //<2>
32+
.secure() //<2>
33+
.http2Settings(builder -> builder.pingInterval(Duration.ofMillis(100))); // <3>
3134

3235
Tuple2<String, HttpHeaders> response =
3336
client.get()

0 commit comments

Comments
 (0)