Protocols
Last updated
Was this helpful?
Last updated
Was this helpful?
Grey Matter supports a variety of network protocols. This doc describes each type of connections we support and how to configure it.
Http is the default network protocol. To use http, set the ssl_config
parameter in the domain
and cluster
to an empty bracket, or omit it entirely.
Example cluster
:
example domain
This will ensure the proxy both handles incoming connections and makes outgoing upstream connections as http.
Https is http encrypted with tls. We can enable https by configuring the ssl_config
attribute in the domain
and cluster
objects. Here is an example of a cluster using https
:
and a domain:
At this writing, Grey Matter supports the following http encryption protocols: SSLv2, SSLv3, TLSv1.1, TLSv1.2.
Simply set UPGRADES=websocket
as an environment variable.
Upgrades can also be configured dynamically with the Grey Matter cli. Each proxy object has an attribute upgrades
, which corresponds to the UPGRADES
environment variable. To enable websockets, set upgrades
to "websocket"
. A full example is below:
Note that setting upgrades
configures websocket connections, but will defer to the protocol of the incoming request. This allows for the sidecar to handle websocket connections to certain routes and clusters, and http request for others.
Together, the configured proxy will only handle incoming and create outgoing https requests using and which contain valid cert / key pairs. For more information on different types of https configurations, see on configuring ssl throughout the mesh.
http2 is similar to http, but with added performance and optimizations. For more information see .
Http2 is supported by Grey Matter automatically via envoy's attribute. Each cluster is hard-coded to use the protocol of the downstream cluster. For example, to make a request to a sidecar in front of a http2 service the client should initiate an http2 request. For more detailed information see on making requests to tls and non-tls http2 clusters.
GRPC is an framework that uses as an interface for bidirectional streaming. Currently, GRPC is not supported by Grey Matter.
However, Grey Matter should in theory support the . Using this filter, clients can make http JSON requests to a proxy instance, which is translated into gRPC compliant with the back end service's protobuf definitions. See this of this for more information.
Sidecars are able to field incoming and outgoing tcp connections using . To activate tcp, add envoy.tcp_proxy
to the list of active network filters in the listener
object. You must also specify the upstream cluster in the network_filters.envoy_tcp_proxy
attribute.
For more info see .
Websockets open a two-way interactive stream between the client and server, whereas other protocols such as http are unidirectional. Websockets can be configured for a sidecar sitting in front of a compatible backend service by enabling . This is done in Grey Matter by setting the "upgrade" : "websocket"
attribute in the proxy
object of the sidecar. This can be done in the following ways:
The proxy will see this on startup and write the applicable envoy template. This is a string delimited list which can handle multiple upgrade types. Each upgrade corresponds to an envoy .
See for more detailed examples.