You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virtual-patient/virtual-patient-web/src/main/java/com/supervision/websocket/config/WebSocketConfig.java

24 lines
830 B
Java

package com.supervision.websocket.config;
import com.supervision.websocket.handler.AskWebSocketHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
@Configuration
public class WebSocketConfig implements WebSocketConfigurer {
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(askWebSocketHandler(), "/askSocket")
.setAllowedOrigins("*");
}
@Bean
public WebSocketHandler askWebSocketHandler() {
return new AskWebSocketHandler();
}
}