You're example has a tiny bug, which tripped me up for a few days. You're matchers are case sensitive. So
// Match connections in order:
// First grpc, then HTTP, and otherwise Go RPC/TCP.
- grpcL := m.Match(cmux.HTTP2HeaderField("content-type", "application/grpc"))
+ grpcL := m.Match(cmux.HTTP2HeaderField("Content-type", "application/grpc"))
httpL := m.Match(cmux.HTTP1Fast())
trpcL := m.Match(cmux.Any()) // Any means anything that is not yet matched.
You're example has a tiny bug, which tripped me up for a few days. You're matchers are case sensitive. So