springwebsocketsockjs

Unable to connect to websockets


I am using spring-boot-starter-websocket for WebSocket connection. Server side configuration enter image description here

Client side code:

enter image description here

I am able to connect to websockets when using locally (ws) but when I deploy the app I am unable to connect to websocket(wss). Any clue what I am missing.


Solution

  • I have to enable CORS in the spring configuration.