Flutter_socket_io : Expected 101 but received '400 Bad Request'

Hello everybody,

I have some trouble using the package “flutter_socket_io”. Here is my code :

SocketIO socketIO;
_connectSocket() {
  socketIO = SocketIOManager().createSocketIO("https://my.url", "/");
  socketIO.init();

  _subscribes();
  socketIO.connect();
}

_subscribes() { 
  if (socketIO != null) { 
    socketIO.subscribe("chat.sendMessage", _onSendChatMessage);
    socketIO.subscribe("chat.receiveMessage", _onReceiveChatMessage);
  } 
}

I am trying to connect to my Web Service, but I get this error :

D/FlutterSocketIoPlugin: SocketIO(15739): connect_error: [{“cause”:{“detailMessage”:“Expected HTTP 101 response but was \u0027400 Bad Request\u0027”,“stackTrace”:[],“suppressedExceptions”:[]},“detailMessage”:“websocket error”,“stackTrace”:[],“suppressedExceptions”:[]}]

What should I do ?

Append port with hostname hopefully it will be work fine.

From:
socketIO = SocketIOManager().createSocketIO(“https://my.url”, “/”);

To:
socketIO = SocketIOManager().createSocketIO(“https://my.url:3000”, “/”);