diff --git a/boomerang/src/main/java/boomerang/global/config/WebSocketConfig.java b/boomerang/src/main/java/boomerang/global/config/WebSocketConfig.java index 5cd8a26..bf33453 100644 --- a/boomerang/src/main/java/boomerang/global/config/WebSocketConfig.java +++ b/boomerang/src/main/java/boomerang/global/config/WebSocketConfig.java @@ -30,6 +30,8 @@ public WebSocketConfig(JwtUtil jwtUtil, MemberService memberService, ChatRoomSer @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { registry.addHandler(new ChatWebSocketHandler(chatRoomService), "/ws/chat/*") - .addInterceptors(new WebSocketHandshakeInterceptor(jwtUtil, memberService, chatRoomService, consultationService)); + .addInterceptors(new WebSocketHandshakeInterceptor(jwtUtil, memberService, chatRoomService, consultationService)) + .setAllowedOrigins("http://localhost:8080", "http://localhost:5173", "http://54.252.224.76:80") + .withSockJS(); } } diff --git a/boomerang/src/main/java/boomerang/global/config/WebSocketStompBrokerConfig.java b/boomerang/src/main/java/boomerang/global/config/WebSocketStompBrokerConfig.java index 303c588..c222a48 100644 --- a/boomerang/src/main/java/boomerang/global/config/WebSocketStompBrokerConfig.java +++ b/boomerang/src/main/java/boomerang/global/config/WebSocketStompBrokerConfig.java @@ -35,12 +35,6 @@ public void registerStompEndpoints(StompEndpointRegistry registry) { .addInterceptors(new JwtHandshakeInterceptor(jwtUtil)) .setHandshakeHandler(new WebSocketHandShakeHandler()) .withSockJS(); - - registry.addEndpoint("/ws/chat/{roomId}") - .setAllowedOrigins("http://localhost:8080", "http://localhost:5173", "http://54.252.224.76:80") - .addInterceptors(new JwtHandshakeInterceptor(jwtUtil)) - .setHandshakeHandler(new WebSocketHandShakeHandler()) - .withSockJS(); } } \ No newline at end of file