Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • how set .setAllowedOrigins("*") ? can you give sample ? Commented Feb 7, 2019 at 19:09
  • I suppose he was meaning to add that method call inside WebsocketBrokerConfiguration class, inside registerStompEndpoints class method, like this: registry.addEndpoint("/vrp-websocket") .setAllowedOrigins("*") .withSockJS(); Commented May 22, 2020 at 17:26
  • The problem is Spring Boot will typically not allow setAllowedOrigins("*"). You will need to be more explicit eg setAllowedOrigins("localhost:4200") Commented Sep 3, 2023 at 14:34
  • I can't see any logic behind using the url "ws://localhost:8080/Moda/chatroomServerEndpoint/websocket" when the server end point is "chatroomServerEndpoint". Why do you have to add "/websocket"? However, that is the only way I could get this to work. But I couldn't find any documentation requiring "/websocket" to be added to the endpoint. Commented Sep 3, 2023 at 15:20