Websockets - can they be handled by istio?

already lost days and much hair to trying to get this working inside my istio mesh

  • single(currently) backend service(BE) hosting api on port 3000 and socket.io service listening on 3001
  • multiple replicas of the front end(FE)

works great locally, but hitting a brick wall getting it working in the cluster

trying to get websockets working between FE and BE but getting nowhere fast :sob::sob:

istio version in cluster is 1.11.3

seen some examples were they specify “websocketUpgrade: true” in the virtualservice config, but when i have tried to apply this i get the following error:
error validating data: ValidationError(VirtualService.spec.tcp[0]): unknown field “websocketUpgrade” in io.istio.networking.v1beta1.VirtualService.spec.tcp;
so not sure it is available in my version

any help / pointers would be hugely appreciated

Websocket runs over http, not directly over tcp. Perhaps your issue is that you are using a tcp route when it should be http? If you are truly routing over tcp, then I’m not sure how istio could be implicated, since it would simply be passing through the http stream as-is.

Also, I think the upgrade happens automatically now (e.g. see Web-sockets upgrade not working in alphav3 · Issue #11498 · istio/istio · GitHub)

1 Like