Spring WebSocket Connecting with SockJS to a different domain

Jax’s answer was correct 🙂

The registerStompEndpoints method gives us the opportunity to set the Allowed Origins.
We need to add it before the “withSockJs()” option.

    @Override
    public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
        stompEndpointRegistry.addEndpoint("/BO/socket").setAllowedOrigins("*").withSockJS();
    }

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)