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
- `type 'Null' is not a subtype of type 'b...
When creating a new file using Appwrite Flutter SDK, the file is successfully created on the server, but the client throws the following exception: ``` type ...
- login With OAuth Failed
login With OAuth Failed: when i cliick to login with any of the following (facebook, gmail or apple) am being redirected out of the app to enter my detail, afte...
- Flutter OAuth2 webAuth Bug?
I created with flutter an app where I can login in with my Microsoft Account. When I compile it to Web (WASM) or Android (aab) then there is no problem what so ...