mirror of
https://git.hmsn.ink/rtc-remote/server.git
synced 2026-03-19 16:04:58 +09:00
asdf
This commit is contained in:
14
server.js
14
server.js
@@ -47,20 +47,24 @@ io.on('connection', (socket) => {
|
||||
|
||||
// 2.5. 관리자가 디스플레이 목록 요청
|
||||
socket.on('requestDisplays', (employeeId) => {
|
||||
console.log('requestDisplays', employeeId);
|
||||
const displays = employeeDisplays.get(employeeId);
|
||||
console.log('requestDisplays', displays);
|
||||
if (displays) {
|
||||
socket.emit('availableDisplays', { displays });
|
||||
socket.emit('availableDisplays', displays);
|
||||
} else {
|
||||
socket.emit('error', `직원 ${employeeId}의 디스플레이 정보가 없습니다.`);
|
||||
}
|
||||
});
|
||||
|
||||
// 3. WebRTC 시그널링 (SDP, ICE)
|
||||
socket.on('webrtcSignal', ({ targetId, data }) => {
|
||||
const targetSocketId = employeeSockets.get(targetId);
|
||||
if (targetSocketId) {
|
||||
io.to(targetSocketId).emit('webrtcSignal', { from: socket.id, data });
|
||||
socket.on('webrtcSignal', (data) => {
|
||||
// const targetSocketId = employeeSockets.get(data.targetId);
|
||||
console.log('webrtcSignal', data);
|
||||
if (data.targetId) {
|
||||
io.to(data.targetId).emit('webrtcSignal', data);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// 4. 입력 이벤트 전달 (관리자 → 직원)
|
||||
|
||||
Reference in New Issue
Block a user