dart-lang / web_socket_channel

StreamChannel wrappers for WebSockets.
https://pub.dev/packages/web_socket_channel
BSD 3-Clause "New" or "Revised" License
425 stars 112 forks source link

Websocket connection failed on flutter web #300

Closed sgsm74 closed 11 months ago

sgsm74 commented 11 months ago

Hey guys I have an issue with connecting to websocket in flutter web app, it works fine on android and ios this is a sample of my code

if (kIsWeb) {   
         channelChat = WebSocketChannel.connect(Uri.parse('ws://example.com:1000'));
      } else {
        channelChat = IOWebSocketChannel.connect('ws://example.com:1000');
      }
sgsm74 commented 11 months ago

simply done by changing ws to wss