I am using websocket in react js. frontend connection code is
useEffect(() => {
const isHttps = process.env.REACT_APP_API_BACKENDURL
setSocket(io(isHttps, {
path: process.env.REACT_APP_PATH,
withCredentials: true,
auth: {
token: localStorage.getItem("uuid")
},
transports: ["websocket"],
autoConnect: true,
reconnection: true,
// reconnectionAttempts: "Infinity",
// reconnectionDelay: 1000,
// reconnectionDelayMax: 5000,
// pingTimeout: 5000,
// pingInterval: 5000,
}))
socket?.on("connect_error", (err) => {
console.log(err)
console.log("connection error")
})
}, [])
what are the problem here so web socket automatically send request see network tab.