Skip to content
Back

Realtime connection fails with web socket exception in flutter web and mobile.

  • 0
  • Flutter
  • Cloud
kapilprithviraj
18 Mar, 2024, 05:26

I am using realtime connection in my flutter wb app and flutter mobile app. I face the same issue in both.

Error: WebSocketChannelException: WebSocket connection failed.

dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 327:10 createErrorWithStack dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 337:28 _throw dart-sdk/lib/core/errors.dart 120:5 throwWithStackTrace dart-sdk/lib/async/zone.dart 1386:11 callback dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7 <fn> Error: WebSocketChannelException: WebSocket connection failed.

dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 327:10 createErrorWithStack dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 337:28 _throw dart-sdk/lib/core/errors.dart 120:5 throwWithStackTrace dart-sdk/lib/async/zone.dart 1386:11 callback dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7 <fn>

TL;DR
Developers are facing WebSocketChannelException when trying to establish a realtime connection in their Flutter web and mobile apps. The WebSocket connection is failing, and the error message is being repeated in the logs. **Solution**: - Ensure that the WebSocket connection URL is correct. - Check if there are any network restrictions blocking the connection. - Verify if the WebSocket server is configured properly.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more