Flutter Developer
Hello everyone!
I've been trying, for hours, to get Realtime to work in my Flutter App (for a client).
The subscription always fails, logging this to the console:
I/flutter (25446): Reconnecting in 1 seconds.```
As far as I know, that ":0" isn't supposed to be there.I've triple-checked my Endpoint and it is correct.
My AppWrite instance is self-hosted, on my VPS.These are my Apache directives:Preserve Host headers and set X-Forwarded headers
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"
Enable WebSocket Support
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) "ws://127.0.0.1:8080/$1" [P,L]
WebSocket location for realtime
ProxyPass "/v1/realtime/" "ws://127.0.0.1:8080/v1/realtime/"
ProxyPassReverse "/v1/realtime/" "ws://127.0.0.1:8080/v1/realtime/"
Forward everything else (Appwrite Dashboard and REST API)
ProxyPass "/" "http://127.0.0.1:8080/"
ProxyPassReverse "/" "http://127.0.0.1:8080/"
A cURL command I used to check functionality:
curl -i -N
-H "Connection: Upgrade"
-H "Upgrade: websocket"
-H "Host: appwrite.danfq.dev"
-H "Origin: https://appwrite.danfq.dev"
"https://appwrite.danfq.dev/v1/realtime?project=bubbl&channels%5B%5D=databases.main.collections.winks.documents"
The response:
HTTP/2 400
server: nginx
date: Fri, 11 Apr 2025 16:56:00 GMT
content-type: text/html; charset=UTF-8
content-length: 83
cache-control: must-revalidate,no-cache,no-store
Any ideas?
Thanks in advance!