I am trying to get Client IP which are connecting to the Nodejs websocket server. This blog is what i am follwoing to do so http://blog.seafuj.com/using-elb-with-websockets .This is working and am getting the client IP.
Now my question is this: Once the initial handshake and connection is made from client to server via ELB and ngnix; will the subsequent requests[sendText()] from client go via ELB Or will they go directly to the websoket server bypassing the ELB.
Sample Client code:
var connection = ws.connect('ws://<ELB>:80');
connection.on("connect", function () {
console.log("Connection established");
connection.sendText("Hi");
connection.sendText("Hello");
})
Over here in comments i read that
2) From this moment on and for the lifetime of this TCP connection, the ELB maintains a quasi-direct connection between client and backend server. 3) "quasi-direct" means that the connection is proxied through the ELB. So while the TCP connection is alive, the ELB is fully aware of the two end points taking part (client and backend server). – Jan-Philip Gehrcke
How ever it is not clear to me whether the tcp requests [not the handshake and connection establishment ] go directly to the server OR via ELB->ngnix -> websoket server.