I'm trying to use the socket client, but all the attempts were unsuccessful, I did the same in the documentation and it didn't work.
import { io } from 'socket.io-client';
export function testUsingWithNodeHTTPServer () {
console.log('=============SOCKET===============')
const socket = io('http://localhost:8080', {
path:" /chat/socket",
extraHeaders: {
session_id: "452c6c87-30ad-4ed7-bfc5-467dd5633d1d"
}
})
socket.on("connect", () => {
console.log('Client connected.');
})
}
Version:
"socket.io-client": "4.3.2",