Home > Software engineering >  Flutter - Invalid argument(s): No host specified in URI "ws:localhost:3000"
Flutter - 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

Error in ios device

Please help me! Thanks for any support

CodePudding user response:

Not sure but you can try

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

//Or

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

//Or

Uri.parse('wss:localhost:3000')

  • Related