Websocket in Spring Boot app - Getting 403 Forbidden

后端 未结 3 915
长发绾君心
长发绾君心 2021-02-02 09:26

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).

<
3条回答
  •  半阙折子戏
    2021-02-02 09:52

    try to add

    registry.addEndpoint("/your-end-point").setAllowedOrigins("*").withSockJS();
    

    "your-end-point" is registered by @SendTo in controller I guess

提交回复
热议问题