Skip to content

Commit

Permalink
[FIX] socket option
Browse files Browse the repository at this point in the history
  • Loading branch information
HYEOK9 committed Nov 8, 2023
1 parent 18556a9 commit c69a4ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/data/backend/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { io, Socket } from "socket.io-client";
export class SocketRepository {
socket: Socket;
constructor(roomId: number, onMessage: (message: AppMessage) => void) {
this.socket = io(import.meta.env.VITE_API_BASE_URL);
this.socket = io(import.meta.env.VITE_API_BASE_URL, {
transports: ["websocket"],
withCredentials: true,
});

this.socket.emit("join", `${roomId}`);
this.socket.on("message", onMessage);
Expand Down

0 comments on commit c69a4ff

Please sign in to comment.