I get this error when I try to connect to my websocket server:
Error during WebSocket handshake: origin mismatch: http://skerit.com != http://kipdola.be
Sure enough, I had to put in an origin response, like this:
self.client.send("Sec-WebSocket-Origin: http://kipdola.be\r\n")
self.client.send("Sec-WebSocket-Location: ws://kipdola.be:1234/\r\n")
But how do I set it to allow multiple origins?
You just echo back the origin the user provided in the request, the request looks somewhat like this:
You perform a serverside check if the
Originheader is in your list of allowed origins and just echo the origin back to the client: