File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
backend/src/main/java/io/f1/backend/global/config Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package io .f1 .backend .global .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+ @ Configuration
10+ @ EnableWebSocketMessageBroker
11+ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
12+
13+
14+
15+ @ Override
16+ public void registerStompEndpoints (StompEndpointRegistry registry ) {
17+ registry .addEndpoint ("/ws/game-room" )
18+ .setAllowedOriginPatterns ("*" )
19+ .withSockJS ();
20+ }
21+
22+ @ Override
23+ public void configureMessageBroker (MessageBrokerRegistry registry ) {
24+ registry .enableSimpleBroker ("/sub" );
25+ registry .setApplicationDestinationPrefixes ("/pub" );
26+ }
27+
28+
29+ }
You can’t perform that action at this time.
0 commit comments