Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
glbrntt committed Dec 4, 2024
1 parent 4b8d242 commit bd892c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@ Bootstrapping a client or server is made easier using the `.http2NIOPosix` short
try await withGRPCClient(
transport: try .http2NIOPosix(
target: .dns(host: "localhost", port: 31415),
config: .defaults(transportSecurity: .tls(.defaults))
transportSecurity: .tls
)
) { client in
// ...
}

// Create a server listening on "127.0.0.1" on any available port
// using default plaintext security configuration.
// Create a plaintext server listening on "127.0.0.1" on any available port
// modifying the default configuration to set max concurrent streams to 256.
try await withGRPCServer(
transport: .http2NIOPosix(
address: .ipv4(host: "127.0.0.1", port: 0),
config: .defaults(transportSecurity: .plaintext)
transportSecurity: .plaintext,
config: .defaults { config in
config.http2.maxConcurrentStreams = 256
}
),
services: [...]
) { server in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Bootstrapping a client or server is made easier using the `.http2NIOTS` shorthan
try await withGRPCClient(
transport: try .http2NIOTS(
target: .dns(host: "localhost", port: 31415),
config: .defaults(transportSecurity: .tls(.defaults))
transportSecurity: .tls
)
) { client in
// ...
Expand All @@ -42,7 +42,10 @@ try await withGRPCClient(
try await withGRPCServer(
transport: .http2NIOTS(
address: .ipv4(host: "127.0.0.1", port: 0),
config: .defaults(transportSecurity: .plaintext)
transportSecurity: .plaintext,
config: .defaults { config in
config.http2.maxConcurrentStreams = 256
}
),
services: [...]
) { server in
Expand Down

0 comments on commit bd892c1

Please sign in to comment.