<p>Websockets don't really have any handling for this per se. You could build your own system but generally the idea for HA is that if anything happens you'll set the client up to automatically reconnect. There will be some non-zero downtime during a blue-green swap but if your app is well built it should handle that already.</p>

<p>If you wanted something more smooth, you could build a message in to your protocol to connect to a new server and then drop the original connection.</p>

CC BY-SA 3.0
2017-02-28T23:41:28.480Z
2017-02-28T23:41:28.480Z
coderanger
<p>With a minimally engineered server code (a Google AppEngine application in the example) it's possible to duplicate and forward incoming HTTP traffic received by a production server to a test server (or vice-versa) for the purpose of comparing their responses. See <a href="https://stackoverflow.com/questions/38799566/can-i-asynchronously-duplicate-a-webapp2-requesthandler-request-to-a-different-u">https://stackoverflow.com/questions/38799566/can-i-asynchronously-duplicate-a-webapp2-requesthandler-request-to-a-different-u</a>.</p>

CC BY-SA 3.0
2017-02-28T23:38:53.120Z
Websockets aren't really normal HTTP traffic.
coderanger
CC BY-SA 4.0
2024-05-27T21:18:03.877Z
Do you perhaps know how to answer this question as well? Here:  https://devops.stackexchange.com/questions/19340/green-blue-deployments-with-multiple-development-teams
CodeMonkey
CC BY-SA 3.0
2017-02-28T22:30:17.207Z
2017-02-28T23:11:06.403Z
2017-05-23T12:39:34.013Z
Dan Cornilescu
<p>A blue green deploy involves pumping live prod data flows (blue) into a hot swap non prod environment (green) in preparation to deploy to live the green environment, such that the green has full data sync with the previous prod blue environment.  </p>

<p>I am wondering what people are using to live copy ongoing websocket traffic from blue to green do I write my own or is there a publish/subscribe websocket library or possibly a different approach to blue green?</p>

<p>My app has nodejs REST servers which also manage websocket traffic from mobile devices ... a mongodb server, etc ... each in containers on GCE/AWS</p>

<p>I realize I could just keep the mongodb in sync from blue to green however that would not exercise the green nodejs servers with live traffic which is a nice regression sanity check I am looking for</p>

<p>Possibly if I just live forward HTTP traffic the underlying websocket which runs atop HTTP will just take care of itself and not demand specific blue green setup</p>

CC BY-SA 3.0
2017-02-28T22:03:15.443Z
Can you please confirm if you're deploying DB servers or HTTP servers?
Purefan
CC BY-SA 3.0
2017-03-01T02:59:29.513Z
Related question and answer on SO http://stackoverflow.com/questions/10257770/how-to-deploy-a-websocket-server
Evgeny Zislis
<deployment><bluegreen><http>
To design a blue green deploy how to publish websocket traffic from live to hot swap server
Scott Stensland
# To design a blue green deploy how to publish websocket traffic from live to hot swap server

(Asked by: username_0 on 2017-02-28)

A blue green deploy involves pumping live prod data flows (blue) into a hot swap non prod environment (green) in preparation to deploy to live the green environment, such that the green has full data sync with the previous prod blue environment.

I am wondering what people are using to live copy ongoing websocket traffic from blue to green do I write my own or is there a publish/subscribe websocket library or possibly a different approach to blue green?

My app has nodejs REST servers which also manage websocket traffic from mobile devices ... a mongodb server, etc ... each in containers on GCE/AWS

I realize I could just keep the mongodb in sync from blue to green however that would not exercise the green nodejs servers with live traffic which is a nice regression sanity check I am looking for

Possibly if I just live forward HTTP traffic the underlying websocket which runs atop HTTP will just take care of itself and not demand specific blue green setup

**Tags:** deployment, bluegreen, http

> **Comments:**
> **username_1**: Can you please confirm if you're deploying DB servers or HTTP servers?  
> **username_2**: Related question and answer on SO http://stackoverflow.com/questions/10257770/how-to-deploy-a-websocket-server  

---

## 2 answers

### Answer by username_4 on 2017-02-28. Score: 5 | Accepted answer

With a minimally engineered server code (a Google AppEngine application in the example) it's possible to duplicate and forward incoming HTTP traffic received by a production server to a test server (or vice-versa) for the purpose of comparing their responses. See <https://stackoverflow.com/questions/38799566/can-i-asynchronously-duplicate-a-webapp2-requesthandler-request-to-a-different-u>.

> **Comments:**
> **username_3**: Websockets aren't really normal HTTP traffic.  
> **username_5**: Do you perhaps know how to answer this question as well? Here:  https://devops.stackexchange.com/questions/19340/green-blue-deployments-with-multiple-development-teams  

---

### Answer by username_3 on 2017-02-28. Score: 6

Websockets don't really have any handling for this per se. You could build your own system but generally the idea for HA is that if anything happens you'll set the client up to automatically reconnect. There will be some non-zero downtime during a blue-green swap but if your app is well built it should handle that already.

If you wanted something more smooth, you could build a message in to your protocol to connect to a new server and then drop the original connection.


---

