@alaski: (if i understand this correctly) the problem is that a malicious website can initiate a connection directly to the websocket server on behalf of the user (thus using the previously stored token), and without a check on the origin this will effectively hijack the session.
For what it worth, I doubt there is a real use-case of having the connection origin different from the host. The proposed fix seems good to me.
@alaski: (if i understand this correctly) the problem is that a malicious website can initiate a connection directly to the websocket server on behalf of the user (thus using the previously stored token), and without a check on the origin this will effectively hijack the session.
For what it worth, I doubt there is a real use-case of having the connection origin different from the host. The proposed fix seems good to me.