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:
committed by
Soheil Hassas Yeganeh
parent
7e08502c7a
commit
bb79a83465
@@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user