I'm looking into how to set up an active/inactive deployment system in node.js. This is a system where there are two running servers, but only one of them is receiving production traffic. One way to do this is to have a proxy server that dynamically switches from forwarding traffic to server A, to forwarding traffic instead to server B.
In any case, I'm concerned about resource waste, and so I want to know if proxies always have to pass all the data through that additional server. I would think it would be most efficient to have the connection handed off in full to one server or the other, so that once the connection is handed off, the proxy doesn't have to do any more work for that connection.
Is this simply not how proxies work? Is there a way to do this kind of thing transparently for websockets and/or http?