SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Configuration
  2. @EnableWebSocketMessageBroker
  3. public class WebSocketConfiguration implements WebSocketMessageBrokerConfigurer {
  4.  
  5.     @Override
  6.     public void registerStompEndpoints(StompEndpointRegistry registry) {
  7.         registry.addEndpoint("/ws")
  8.                 .setAllowedOrigins("*")
  9.                 .withSockJS();
  10.     }
  11.  
  12.     @Override
  13.     public void configureMessageBroker(MessageBrokerRegistry registry) {
  14.         registry.setApplicationDestinationPrefixes("/app");
  15.         registry.enableSimpleBroker("/topic");
  16.     }
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top