List of usage examples for org.springframework.web.socket.config.annotation StompWebSocketEndpointRegistration setAllowedOrigins
StompWebSocketEndpointRegistration setAllowedOrigins(String... origins);
From source file:org.appverse.web.framework.backend.frontfacade.websocket.autoconfigure.FrontFacadeWebSocketAutoConfiguration.java
@Override public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) { logger.info("Initializing websocket standard on path:'{}' ...", defaultWebsocketEndpointPath); StompWebSocketEndpointRegistration webSockedEndpoint = stompEndpointRegistry .addEndpoint(defaultWebsocketEndpointPath); logger.info("Initializing websocket sockJs on path:'{}' ...", defaultSockJsEndpointPath); StompWebSocketEndpointRegistration sockJsEndpoint = stompEndpointRegistry .addEndpoint(defaultSockJsEndpointPath); sockJsEndpoint.withSockJS();/*from w w w . ja v a 2 s .c o m*/ if (Boolean.valueOf(corsEnabled)) { logger.info("Initializing cors on websockets"); webSockedEndpoint.setAllowedOrigins(StringUtils.commaDelimitedListToStringArray(allowedOrigins)); sockJsEndpoint.setAllowedOrigins(StringUtils.commaDelimitedListToStringArray(allowedOrigins)); } }