dart-websocket
dart-websocket copied to clipboard
It can't run in Chrome
flutter run -d chrome
Flutter 1.10.7 • channel dev • https://github.com/flutter/flutter.git Framework • revision e70236e36c (17 hours ago) • 2019-10-02 09:32:30 -0700 Engine • revision 9e6314d348 Tools • Dart 2.6.0 (build 2.6.0-dev.0.0 1103600280)
======================
Launching lib/main.dart on Chrome in debug mode... Building application for the web... Throwing away cached asset graph because the build phases have changed. This most commonly would happen as a result of adding a new dependency or updating your dependencies. Skipping compiling nb|lib/main_web_entrypoint.dart with ddc because some of its transitive libraries have sdk dependencies that not supported on this platform:
import 'package:websocket/websocket.dart';
https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings
Attempting to connect to browser instance..
Thanks for reporting, im travelling, thus it might take me awhile to look at it
Fixed. It works after I switch to the latest master branch. Appreciate it
https://github.com/flutter/flutter/issues/42228
It works in Flutter for IOS and Flutter web. But it is not working in Flutter for Android.
try { this.socket = await WebSocket.connect(WsUrl); } catch (e) { print(e) }
got this: OS Error: Connection refused, errno = 111, address = localhost, port = 54895
what can I do now? Thanks
@greatGregLiu I doubt it's the server part (as the error says, "connection refused"). Please try to set WsUrl = "wss://echo.websocket.org"
first to see whether it can connect to this referential implementation. Also, what WS server are using.
@greatGregLiu I doubt it's the server part (as the error says, "connection refused"). Please try to set
WsUrl = "wss://echo.websocket.org"
first to see whether it can connect to this referential implementation. Also, what WS server are using.
thanks. It works. In android emulator, it points to localhost which is not what I wanted and this is the reason that does not work