-
Notifications
You must be signed in to change notification settings - Fork 4
소켓 명세서
Kang Minji edited this page Nov 23, 2021
·
12 revisions
io(${url}/team-${teamId});
팀 namespace: /team-teamId(숫자)
Emit (Client → Server)
{
teamId: 1,
userId: '23523464' | '[email protected]',
}
Emit (Client → Server)
users room 참가
Emit (Client → Server)
users room 나가기
Emit (Server→ Client)
{
onlineUsers: [{ userId: '23523464' }, { userId: '[email protected]' }]
}
room이름: chat-{chatId}
Emit (Client → Server)
{
chatRooms: [{ chatRoomId: 1 }, { chatRoomId:2 }]
}
채팅방(chat-room) 참가
Emit (Client → Server)
{
chatRooms: [{ chatRoomId: 1 }, { chatRoomId:2 }]
}
채팅방(chat-chatId) 나가기
Emit (Client → Server)
{
content: '내용',
userId: 1,
chatRoomId: 1,
}
Emit (Server → Client)
in chat-id room
{
messageId: 1,
content: '내용',
userId: 1,
createdAt: Date,
chatRoomId: 1,
}
Emit (Client→ Server)
{
chatRoomId: 1,
userList: [{ userId: 1 }, { userId: 2 }]
teamId: 1,
}
Emit (Client → Server)
{
chatRoomId: 1,
}
Emit (Server → Client)
Emit (Server → Client)
Emit (Client → Server)
{
chatRoomId: 1,
}