I am using socket.io with nodejs and an apache server over it. I am getting a code 200 as response, I know I must get
I use springboot 2 + stomp.
In my case ,the reason is in WebSocketConfig,must remove .withSockJS
.
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws").setAllowedOrigins("*")
.addInterceptors(new HandshakeInterceptor())
//--> important must remove,or 200 error.
//.withSockJS()
;
}
This means your requests are not being proxied to your WebSocket handler, but for some other route which returns a 200.
You should check your WebSocket handler.