Web sites begin life under the handshake of an HTTP update. Once the handshake is successfully completed, you will return to a long bi-directional Internet connection.
If you use Nginx as a proxy for websites, you can also use "X-Forwarded-For", but only with a handshake. See for example this simple configuration :
# WebSocket Proxy
... and some links to this page .
You configure what Nginx should send in the update request (the information you use to identify the client), and this will be your job on the server to use the information from the handshake to identify the client, and then connect the connection to the web server with your client . Based on this association, any message that arrives at this web socket connection belongs to a previously identified client.
source share