From e885ea5a5a23da7fd80f953d13c3c79c11f3f983 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Mon, 10 Jan 2022 16:26:07 -0500 Subject: [PATCH] Update README.md gRPC-Go has been waiting for the settings frame for a while now (https://github.com/soheilhy/cmux/issues/64), and having the old handler in the example is confusing users (https://github.com/soheilhy/cmux/issues/67). Use the new handler in the example and remove the "Limitations" from the README. --- README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c4191b7..5c7d6d7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ m := cmux.New(l) // Match connections in order: // First grpc, then HTTP, and otherwise Go RPC/TCP. -grpcL := m.Match(cmux.HTTP2HeaderField("content-type", "application/grpc")) +// cmux.HTTP2MatchHeaderFieldSendSettings ensures we can handle any gRPC client. +grpcL := m.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc")) httpL := m.Match(cmux.HTTP1Fast()) trpcL := m.Match(cmux.Any()) // Any means anything that is not yet matched. @@ -68,13 +69,6 @@ when it's accepted. For example, one connection can be either gRPC or REST, but not both. That is, we assume that a client connection is either used for gRPC or REST. -* *Java gRPC Clients*: Java gRPC client blocks until it receives a SETTINGS -frame from the server. If you are using the Java client to connect to a cmux'ed -gRPC server please match with writers: -```go -grpcl := m.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc")) -``` - # Copyright and License Copyright 2016 The CMux Authors. All rights reserved.