flutterdartemulation

Flutter WebSocket works in web application but not in android emulator


final channel = WebSocketChannel.connect(
  Uri.parse('wss://echo.websocket.org'),
);
  1. can create and connect in web application but can't connect in android emulator

Solution

    1. In my project WebSocket connection needs authentication
    2. In web application automatically pass cookies and authentication token in WebSocket connection
    3. But in Mobile Application we need to set cookies and authentication token manually

    When I done this resolved my issue