diff --git a/spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/SampleUndertowWebSocketsApplication.java b/spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/SampleUndertowWebSocketsApplication.java index 938fc1d4f5..64454316c6 100644 --- a/spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/SampleUndertowWebSocketsApplication.java +++ b/spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/SampleUndertowWebSocketsApplication.java @@ -45,8 +45,10 @@ public class SampleUndertowWebSocketsApplication extends SpringBootServletInitia @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { - registry.addHandler(echoWebSocketHandler(), "/echo").withSockJS(); - registry.addHandler(snakeWebSocketHandler(), "/snake").withSockJS(); + registry.addHandler(echoWebSocketHandler(), "/echo").setAllowedOrigins("*") + .withSockJS(); + registry.addHandler(snakeWebSocketHandler(), "/snake").setAllowedOrigins("*") + .withSockJS(); } @Override