I spend a whole day just to find that the issue is caused by /v1/realtime path can't be used.
It always returns nonsense 400 bad request like in the screenshot.
This should be stated in the documentation.
TL;DR
The `/v1/realtime` path is taken by Appwrite's system service, causing 400 bad requests. This issue should be documented for developers.