Comment
Comment by mic159
The websocket server needs to check the "Origin" header from the client. The code then needs to know what is expected (eg localhost or 127.0.0.q).
If the origin header is something like "evil.xyz.com", then it needs to reject the connection.