Websocket in Spring Boot app - Getting 403 Forbidden
I can connect to the websocket from client using sockjs/stompjs when I run this in eclipse (no spring boot).
<
I had a similar issue and fixed it in the WebSocketConfig by setting the allowed origins to "*".
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
// the endpoint for websocket connections
registry.addEndpoint("/stomp").setAllowedOrigins("*").withSockJS();
}
// remaining config not shown as not relevant
}