Does Consul Connect support WebSockets?

Hello,

I am evaluating Nomad/Consul Connect/Vault to deploy an existing set of microservices built using Spring Cloud. These use GraphQL subscriptions heavily, and therefore use websockets.

I am experiencing the following errors and it seems to me that the websocket connections are not being established.

Does Consul Connect support using websockets through the mesh?

I have found some documentation that suggests I first need to switch to the http protocol ( https://www.consul.io/docs/connect/proxies/envoy#protocol ) and then I would be blocked by this issue ( https://github.com/hashicorp/consul/issues/8283 ).

However I am clutching at straws a little, as right now it seems as though I would be using the default protocol of tcp, on which websocket connections appear to be failing.

So in the first instance I am looking for some help in knowing just what Consul Connect supports and how it should be configured.

Does anyone have any experience of using websockets over Consul Connect, is that supported?

04-12-2020 15:37:07.217 [reactor-http-epoll-1] WARN  r.n.http.client.HttpClientConnect - [id: 0x62c5edde, L:/127.0.0.1:52212 - R:127.0.0.1/127.0.0.1:83] The connection observed an error
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid handshake response getStatus: 401 
	at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13.verify(WebSocketClientHandshaker13.java:274)
	at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker.finishHandshake(WebSocketClientHandshaker.java:302)
	at reactor.netty.http.client.WebsocketClientOperations.onInboundNext(WebsocketClientOperations.java:118)
	at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:96)

Hi @awarner-greshamtech,

Consul currently does not support WebSockets upgrades thru any Envoy proxy when the associated service is registered in Connect with a protocol of HTTP. The issue you linked which I filed is current, and still needs to be resolved for that work.

WebSockets do however function when the service’s protcol is configured as TCP.

Thanks @blake,

It turns out my issue presented itself as a websockets issue but was not. Our websocket subscriptions work OK over the TCP proxies now.

We would however be prevented from using some of the advanced L7 Consul Connect features that require HTTP proxies (e.g. Canary deployments) so we would appreciate https://github.com/hashicorp/consul/issues/8283 being fixed.