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
<html><body><h2>HTTP 400 Bad Request</h2><hr><i>Powered by Swoole</i></body></html> ```Any ideas? Thanks in advance!
Recommended threads
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support š I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...