'Not able to connect flutter socket socket_io_client 1.0.1 to nodejs server

**Not able to connect websocket to the nodejs server for websocket connection I'm using socket_io_client: ^1.0.1 library **
void connect(){

    IO.Socket socket = IO.io('https://MY Url', <String, dynamic>{
   'transports': ['websocket'],
   'autoConnect': false,
});
socket.connect();
socket.on('connect', (_) => print('connect: ${socket.id}'));
socket.onConnectError((data) => print(data));
socket.emit('/test', 'test');"
 print("hello");
  print(socket.connected);
  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source