The first thing that comes to mind would be if the connection becomes idle. In that case, I could see the server closing it. You mentioned seeing ping/pong requests. Are these consistent or are they running and stopping? If they're consistently running up to the 30s mark when the connection closes then the connection is probably not being closed because of an idle time issue. In that case, maybe check the logs to see what happening? You could try turning up the log level for `org.springframework.web` to DEBUG. That might show more info when the server ends the connection.
Outside of that:
- Try a different WebSocket client and see if it behaves the same? For example, try with Chrome.
- Post an example. If you can replicate the problem, add or link to an example and I can take a closer look to see what's happening.
Hope that helps!