Closed five-lei closed 5 years ago
i meet this problem too just adding: ws.addHeader("Origin","app:myapp"); solve my problem
@five-lei There are many possible reasons that can cause 403 Forbidden
. As @mehran22k showed an example, that kind of issues can be solved by adding some HTTP headers in most cases. Otherwise, the configuration of the server is wrong. If "101 Switching Protocols" is not returned, it means that the server does not accept a WebSocket connection for some reasons.
com.neovisionaries.ws.client.OpeningHandshakeException: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 403 Forbidden