Home > Mobile >  Invalid argument(s): No host specified in URI "ws:localhost:3000"
Invalid argument(s): No host specified in URI "ws:localhost:3000"

Time:07-22

I will try connect Websocket with flutter

   final _channel = WebSocketChannel.connect(
    Uri.parse('ws:localhost:3000'),
  );

It working with web platfrom but i run it in ios or masOs destop,... it return Error:

Invalid argument(s): No host specified in URI http://:0/localhost:3000

Please help me! Thanks for any support

CodePudding user response:

you can use

Uri.parse('ws://localhost:3000')

Ios doesnt accept url if its not in the format of a normal url in websockets

  • Related