File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/main/kotlin/com/back/koreaTravelGuide/domain/userChat/config Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.back.koreaTravelGuide.domain.userChat.config
2+
3+ import org.springframework.context.annotation.Configuration
4+ import org.springframework.messaging.simp.config.MessageBrokerRegistry
5+ import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker
6+ import org.springframework.web.socket.config.annotation.StompEndpointRegistry
7+ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
8+
9+ // userChat에서만 사용할 것 같아서 전역에 두지 않고 userChat 도메인에 두었음
10+
11+ @Configuration
12+ @EnableWebSocketMessageBroker
13+ class UserChatWebSocketConfig : WebSocketMessageBrokerConfigurer {
14+ override fun registerStompEndpoints (registry : StompEndpointRegistry ) {
15+ registry.addEndpoint(" /ws/userchat" )
16+ .setAllowedOriginPatterns(" *" )
17+ .withSockJS()
18+ }
19+
20+ override fun configureMessageBroker (registry : MessageBrokerRegistry ) {
21+ registry.enableSimpleBroker(" /topic" )
22+ registry.setApplicationDestinationPrefixes(" /pub" )
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments