implement WebSocket origin checking