Enabling Cross Origin Requests for WebSockets in Spring

前端 未结 2 962
长发绾君心
长发绾君心 2021-02-04 08:24

I have a OpenShift Wildfly server. I am building a website with the Spring MVC framework. One of my webpages also uses a WebSocket connection. On the server side, I

2条回答
  •  不思量自难忘°
    2021-02-04 08:51

    I don't think it's a CORS issue because it's connected successully before being disconnected. If that's CORS, you can't even connect.

    I think it's a communication problem between your DNS & openshift because WebSocket need a persistent connection (long-live) which keeps opening between client & server. If your DNS (e.g. CloudFlare or something like that) does not support / not configured to use WebSocket, the client would be disconnected immediately as in your issue.

提交回复
热议问题