List of usage examples for org.springframework.web.socket.config.annotation StompWebSocketEndpointRegistration withSockJS
SockJsServiceRegistration withSockJS();
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(); if (Boolean.valueOf(corsEnabled)) { logger.info("Initializing cors on websockets"); webSockedEndpoint.setAllowedOrigins(StringUtils.commaDelimitedListToStringArray(allowedOrigins)); sockJsEndpoint.setAllowedOrigins(StringUtils.commaDelimitedListToStringArray(allowedOrigins)); }//from w ww . j a va 2 s . c o m }