2
0
mirror of https://github.com/soheilhy/cmux.git synced 2026-08-04 07:00:50 +08:00

Add matchers for header value prefixes

This commit is contained in:
Peter Edge
2017-08-14 12:23:22 -04:00
committed by Soheil Hassas Yeganeh
parent 7e08502c7a
commit bb79a83465
3 changed files with 65 additions and 13 deletions

View File

@@ -112,7 +112,7 @@ func Example() {
// We first match the connection against HTTP2 fields. If matched, the
// connection will be sent through the "grpcl" listener.
grpcl := m.Match(cmux.HTTP2HeaderField("content-type", "application/grpc"))
grpcl := m.Match(cmux.HTTP2HeaderFieldPrefix("content-type", "application/grpc"))
//Otherwise, we match it againts a websocket upgrade request.
wsl := m.Match(cmux.HTTP1HeaderField("Upgrade", "websocket"))