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
- Error With iOS Apps
I keep getting the below errors for my flutter app. The clients are registered and have been. This wasn't an issue a few hours ago. AppwriteException: AppwriteE...
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...