File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
backend/src/main/java/com/deliveranything/global/config Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 2727import org .springframework .messaging .support .ChannelInterceptor ;
2828import org .springframework .messaging .support .MessageHeaderAccessor ;
2929import org .springframework .security .authentication .UsernamePasswordAuthenticationToken ;
30- import org .springframework .security .config .annotation .web .socket .EnableWebSocketSecurity ;
3130import org .springframework .security .core .Authentication ;
3231import org .springframework .security .core .GrantedAuthority ;
3332import org .springframework .security .core .userdetails .UserDetails ;
34- import org .springframework .web .socket .config .annotation .EnableWebSocketMessageBroker ;
3533import org .springframework .web .socket .config .annotation .StompEndpointRegistry ;
3634import org .springframework .web .socket .config .annotation .WebSocketMessageBrokerConfigurer ;
3735
3836@ Slf4j
3937@ Configuration
40- @ EnableWebSocketMessageBroker
41- @ EnableWebSocketSecurity
4238@ RequiredArgsConstructor
4339public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
4440
@@ -52,7 +48,13 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
5248 public void registerStompEndpoints (StompEndpointRegistry registry ) {
5349 registry .setErrorHandler (stompErrorHandler );
5450 registry .addEndpoint ("/ws" )
55- .setAllowedOriginPatterns ("*" )
51+ .setAllowedOriginPatterns (
52+ "http://localhost:*" ,
53+ "https://localhost:*" ,
54+ "https://cdpn.io" ,
55+ "https://www.deliver-anything.shop" ,
56+ "https://api.deliver-anything.shop"
57+ )
5658 .withSockJS ();
5759 }
5860
You can’t perform that action at this time.
0 commit comments