-2

I just finished this tutorial and it works on localhost (when I'm run backend on localhost:8080 and front on localhost:4200), but when I put my *.war file on server there is some CORS problem.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ‘http://mydomain.pl/ws/info?t=1591451334475’. (Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’)

I change this to allow but this not working :(

@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
    registry.addEndpoint("/ws")
            .setAllowedOrigins("*")
            .withSockJS();
}

Could You hep me? I don't know what I'm doing wrong

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
NoIdeaMan
  • 43
  • 6

1 Answers1

0

The problem is wildfly. I just run jar on server without wildfly and the websocket works correctly. I'm probably don't configured something in wildfly.

NoIdeaMan
  • 43
  • 6