Socket connection (Socket.io) issue in React node live environment (Locally working fine)

I have application created in react and i am using socket.io-client library for Connection.
When i am trying to deploy my app on prod the socket is not connecting.

Here is my frontend socket config:-
const socket = io.connect(socketBaseUrl, { extraHeaders: { "Access-Control-Allow-Origin": "*", }, transports: ["websocket", "polling"], // I need to use websocket (not polling) });

enter image description here

I have tried many different ways but no success.

  • transports: [“polling”] -> working fine in prod
  • transports: [“websocket”, “polling”] -> not working when i first add websocket

Is there something which i have missed?