WebSockets protocol with CloudFront
While CloudFront natively supports websockets, there is one major pitfall you can end up running into:
You can't use a custom port for the WebSocket connection
If you're running some server that has say, Apache serving normal HTTP/HTTPS requests and a Node.js or other application using another port to listen for WebSockets requests - it won't work. For unknown reasons, CloudFront simply does not care if you want to use a different port.
You need to have your WebSocket servers set up purely to handle WebSocket traffic and not other traffic (i.e. you need Apache off, so you can use port 443 for wss:// or port 80 for ws:// connections).