Skip to content

Commit 2d1c8ca

Browse files
authored
Demonstrate multi-address client in HTTP examples (#2689)
Motivation: Some HTTP examples only use single-address client. It would be helpful to also provide multi-address client examples. Modification: - Create `DebuggingExampleUrlClient` - Create `HttpUrlClientMutualTLS` - Create `Http2PriorKnowledgeUrlClient` - Create `HttpUrlClientWithAlpn` Result: Both single-address and multi-address clients are demonstrated in HTTP examples.
1 parent 2407608 commit 2d1c8ca

File tree

5 files changed

+404
-4
lines changed

5 files changed

+404
-4
lines changed

Diff for: servicetalk-examples/docs/modules/ROOT/pages/http/index.adoc

+10-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ Extends the async "Hello World" example to demonstrate some useful features avai
9090

9191
* link:{source-root}/servicetalk-examples/http/debugging/src/main/java/io/servicetalk/examples/http/debugging/DebuggingExampleServer.java[DebuggingExampleServer] - the async `Hello World!`
9292
server enhanced with debugging capabilities.
93-
* link:{source-root}/servicetalk-examples/http/debugging/src/main/java/io/servicetalk/examples/http/debugging/DebuggingExampleClient.java[DebuggingExampleClient.java] - the async `Hello World!` client enhanced with debugging capabilities.
93+
* link:{source-root}/servicetalk-examples/http/debugging/src/main/java/io/servicetalk/examples/http/debugging/DebuggingExampleClient.java[DebuggingExampleClient.java] - the async `Hello World!` single-address client enhanced with debugging capabilities.
94+
* link:{source-root}/servicetalk-examples/http/debugging/src/main/java/io/servicetalk/examples/http/debugging/DebuggingExampleUrlClient.java[DebuggingExampleUrlClient.java] - the async `Hello World!` multi-address client enhanced with debugging capabilities.
9495

9596
[#Timeout]
9697
== Timeout
@@ -197,7 +198,8 @@ This example demonstrates how client and server can be configured to do mutual a
197198
Using the following classes:
198199

199200
- link:{source-root}/servicetalk-examples/http/mutual-tls/src/main/java/io/servicetalk/examples/http/mutualtls/HttpServerMutualTLS.java[HttpServerMutualTLS] - A server that sets the trust manager and key manager, and requires client authentication.
200-
- link:{source-root}/servicetalk-examples/http/mutual-tls/src/main/java/io/servicetalk/examples/http/mutualtls/HttpClientMutualTLS.java[HttpClientMutualTLS] - A client that sets the trust manager and key manager.
201+
- link:{source-root}/servicetalk-examples/http/mutual-tls/src/main/java/io/servicetalk/examples/http/mutualtls/HttpClientMutualTLS.java[HttpClientMutualTLS] - A single-address client that sets the trust manager and key manager.
202+
- link:{source-root}/servicetalk-examples/http/mutual-tls/src/main/java/io/servicetalk/examples/http/mutualtls/HttpUrlClientMutualTLS.java[HttpUrlClientMutualTLS] - A multi-address client that sets the trust manager and key manager when needed.
201203

202204
NOTE: This example uses the link:#blocking-aggregated[blocking + aggregated] API, as the TLS/SSL configuration API is
203205
the same across all the HTTP APIs.
@@ -280,7 +282,9 @@ link:https://tools.ietf.org/html/rfc7540#section-3.4[HTTP/2 transport with Prior
280282
- link:{source-root}/servicetalk-examples/http/http2/src/main/java/io/servicetalk/examples/http/http2/priorknowledge/Http2PriorKnowledgeServer.java[Http2PriorKnowledgeServer] -
281283
A server that uses HTTP/2 with Prior Knowledge.
282284
- link:{source-root}/servicetalk-examples/http/http2/src/main/java/io/servicetalk/examples/http/http2/priorknowledge/Http2PriorKnowledgeClient.java[Http2PriorKnowledgeClient] -
283-
A client that uses HTTP/2 with Prior Knowledge.
285+
A single-address client that uses HTTP/2 with Prior Knowledge.
286+
- link:{source-root}/servicetalk-examples/http/http2/src/main/java/io/servicetalk/examples/http/http2/priorknowledge/Http2PriorKnowledgeUrlClient.java[Http2PriorKnowledgeUrlClient] -
287+
A multi-address client that conditionally uses HTTP/2 with Prior Knowledge.
284288

285289
=== HTTP/2 via ALPN for secure connections
286290

@@ -290,7 +294,9 @@ communication protocol:
290294
- link:{source-root}/servicetalk-examples/http/http2/src/main/java/io/servicetalk/examples/http/http2/alpn/HttpServerWithAlpn.java[HttpServerWithAlpn] -
291295
A server that negotiates HTTP/2 or HTTP/1.1 using ALPN extension for TLS connections.
292296
- link:{source-root}/servicetalk-examples/http/http2/src/main/java/io/servicetalk/examples/http/http2/alpn/HttpClientWithAlpn.java[HttpClientWithAlpn] -
293-
A client that negotiates HTTP/2 or HTTP/1.1 using ALPN extension for TLS connections.
297+
A single-address client that negotiates HTTP/2 or HTTP/1.1 using ALPN extension for TLS connections.
298+
- link:{source-root}/servicetalk-examples/http/http2/src/main/java/io/servicetalk/examples/http/http2/alpn/HttpUrlClientWithAlpn.java[HttpUrlClientWithAlpn] -
299+
A multi-address client that conditionally negotiates HTTP/2 or HTTP/1.1 using ALPN extension for TLS connections.
294300

295301
If HTTP/1.x protocol is configured ServiceTalk always fallbacks to it if the peer does not support ALPN extension.
296302

0 commit comments

Comments
 (0)