21 lines
837 B
Kotlin
21 lines
837 B
Kotlin
|
|
package at.eisibaer.jbear2.config
|
||
|
|
|
||
|
|
import org.springframework.context.annotation.Configuration
|
||
|
|
import org.springframework.messaging.simp.config.MessageBrokerRegistry
|
||
|
|
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker
|
||
|
|
import org.springframework.web.socket.config.annotation.StompEndpointRegistry
|
||
|
|
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer
|
||
|
|
|
||
|
|
@Configuration
|
||
|
|
@EnableWebSocketMessageBroker
|
||
|
|
class WebSocketConfig : WebSocketMessageBrokerConfigurer {
|
||
|
|
|
||
|
|
override fun configureMessageBroker(registry: MessageBrokerRegistry) {
|
||
|
|
registry.enableSimpleBroker("/game");
|
||
|
|
registry.setApplicationDestinationPrefixes("/app");
|
||
|
|
}
|
||
|
|
|
||
|
|
override fun registerStompEndpoints(registry: StompEndpointRegistry) {
|
||
|
|
registry.addEndpoint("/websocket")
|
||
|
|
}
|
||
|
|
}
|