Move active websocket connection to another upstream host

276 views
Skip to first unread message

Egor Noveo

unread,
Dec 30, 2021, 12:51:39 AM12/30/21
to envoy-dev

Hello Envoy guys,

I'm new user of envoy proxy, maybe someone can help me

I have 2 upstream hosts (UH1 and UH2), and configured envoy proxy to proxy (round robin) websocket connections from a client (frontend) to them.

Let's say UH1 has an active websocket connection (WC1) and UH1 becomes down (closes all its connections) I would like to keep the connection WC1 alive with a client and move the connection to UH2. Could anyone say if it is possible?

Thank you in advance!

P.S.

I asked the same question in https://stackoverflow.com/questions/70515485/envoy-proxy-move-active-websocket-connection-to-another-upstream-host and after found this group, since no one has answered in stackoverflow I decided to try here

Stephan Zuercher

unread,
Dec 30, 2021, 4:26:05 PM12/30/21
to Egor Noveo, envoy-dev
This isn’t currently supported. 

My sense is that one might be able to write an HTTP filter that takes the place of the router filter to support this behavior in conjunction with upgrade configs[1], but it’s probably a lot of work. That filter would probably need to buffer the original HTTP request to be able form a new websocket to a different upstream, and it would need to decode websocket frames to avoid forwarding partial frames. Further if the messages on the websocket are request/response oriented the filter would have buffer websocket frames and have knowledge of their content to avoid dropping requests. 

In my experience, optimizing reconnect from the client and just forming a new websocket connection is simpler to implement and also provides benefits when the connection between the client and Envoy is severed. 
--
You received this message because you are subscribed to the Google Groups "envoy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-dev/0200ef6c-b016-478a-b348-b335db9887cdn%40googlegroups.com.

Egor Noveo

unread,
Jan 10, 2022, 12:03:12 AM1/10/22
to envoy-dev
Many thanks Stephan !
Reply all
Reply to author
Forward
0 new messages