Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ spring:
allowed-origins:
- 'http://localhost:5173'
- 'https://localhost:5173'
- 'https://asyncgate.vercel.app'
- 'https://asyncgate.site'
- 'https://www.asyncgate.site'
allow-credentials: true
allowed-headers: '*'
allowed-methods:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();

config.setAllowCredentials(true);
config.setAllowedOriginPatterns(List.of("http://localhost:5173", "https://localhost:5173"));
config.setAllowedOriginPatterns(List.of("http://localhost:5173", "https://localhost:5173", "https://asyncgate.vercel.app", "https://asyncgate.site", "https://www.asyncgate.site"));
config.addAllowedHeader("*");
config.addAllowedMethod("*");
config.addExposedHeader("Authorization");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public class ExitRoomService implements ExitRoomUseCase {

@Override
public void execute(final String roomId, final String memberId) {
log.info("ExitRoomService.execute 호출됨, roomId: {}, memberId: {}", roomId, memberId);

// 방에서 유저 제거
kurentoManager.removeUser(roomId, memberId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,19 @@ public void removeUser(final String roomId, final String userId) {
// 사용자 정보 제거
userStates.remove(userId);

// 사용자 제거 이벤트 브로드캐스트
// 예: 클라이언트 측에서 해당 사용자의 미디어 스트림 제거 처리를 수행하도록 알림 전송
messagingTemplate.convertAndSend("/topic/removed/" + roomId, userId);

// 선택사항: 방이 비어있다면 미디어 파이프라인도 정리
if (roomEndpoints.get(roomId).isEmpty()) {
MediaPipeline mediaPipeline = pipelines.get(roomId);
// 미디어 파이프라인 해제 코드 (예시)
mediaPipeline.release();
pipelines.remove(roomId); // collection에서 제거
log.info("🚮 [Kurento] 방 {}에 남은 사용자가 없어 미디어 파이프라인을 해제합니다.", roomId);
}

log.info("🛑 [Kurento] 사용자 제거 완료: roomId={}, userId={}", roomId, userId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();

config.setAllowCredentials(true);
config.setAllowedOriginPatterns(List.of("http://localhost:5173", "https://localhost:5173"));
config.setAllowedOriginPatterns(List.of("http://localhost:5173", "https://localhost:5173", "https://asyncgate.vercel.app", "https://asyncgate.site", "https://www.asyncgate.site"));
config.addAllowedHeader("*");
config.addAllowedMethod("*");
config.addExposedHeader("Authorization");
Expand Down
Loading