wrote online chat https://github.com/callicoder/spring- Boot-WebSocket-Chat-Demo
And I want to rewrite the ConfigureMessageBroker method to access another server.
@ override
Public Void ConfigureMessageBroker (MessageBrokerRegistry Registry) {
Registry.EnablestompbrokerRelay ("/ Topic"). SetRelayHost ("Localhost"). Setrelayport (3000);
Registry.setApplicationDestInationPrefixes ("/ app");
}
But the error occurs
io.netty.handler.codec.decoderException: java.lang.illegAlarGumentException: no enum constant org.springframework.messaging.simp.stomp.stompcommand.http / 1.1 400 Bad Request
Answer 1
Try in WebsocketConfig class in the RegisterStompendPoint method (…) Add line
registry.setallowedorigins ("*");