Backport PR #4845: Add Origin Checking to WebSockets