Aditya Dwivedi
Aditya Dwivedi

Reputation: 64

Not able to get any response or error while using Spring Websocket STOMP

I am using code given in this link : https://spring.io/guides/gs/messaging-stomp-websocket/

When I start my application as spring boot, it starts properly and also the web page is opening on port 8080 but when I click on connect or Send My name to connect then nothing is happening, getting no response anywhere and none error. Please can anyone help me with this

Upvotes: 0

Views: 553

Answers (1)

am233dmg
am233dmg

Reputation: 174

You error dispalyed in browser console, you need to check it. In my opinion this problem connected with CORS. Try this:

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {        
         registry.addEndpoint("/gs-guide-websocket").setAllowedOrigins("*").withSockJS();
    }

Upvotes: 1

Related Questions