I’m having a porject, where Springboot is hosting the Angular frontend. The backend is receiving data from a external MQTT-Broker and is supposed to broadcast specific messages that it receives to an internal Broker (I’m using SimpMessagingTemplate for that) that the Angular frontend subscribes to (using RxStompService). In my IDE locally everything works fine, but on the machine I get the error “WebSocket connection to ‘ws://localhost:8080/live’ failed:”. Below is part of my WebSocketConfig, since the obvious problem could be that I setup AllowedOrigins wrong:
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
// Registers the endpoint where the connection will take place
registry.addEndpoint("/live")
.setAllowedOrigins("http://localhost:4200","http://localhost:8080",
"http://192.168.222.222:80","http://192.168.222.222:8080");
}
Below also the Request initiator chain, both on the machine aswell as locally.