spring-cloud-samples / spring-cloud-gateway-sample

Sample Spring Cloud Gateway Application
Apache License 2.0
360 stars 235 forks source link

Cross origin issue #16

Open nanosiddik opened 4 years ago

nanosiddik commented 4 years ago

I am getting the this error "Access to XMLHttpRequest at 'http://localhost:8085/websocket/live-mine/info?t=1593887703692' from origin 'http://localhost:8080' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'http://localhost:8080, http://localhost:8080', but only one is allowed." actually i have deployed first service and eureka in one AWS machine and second ,notification deployed in another AWS machine and gateway is running in local and i am accessing from another web application in local. I have created a cross filter class . for rest api its working fine but for websocket its not working i am getting the mentioned error . I have been trying for the last two week . till now not solved .Please help me .

nanosiddik commented 4 years ago

First service, second service,notification service (websocket stomp with sock js) ,spring cloud gateway,web for accessing . every service deploy different machine in cloud aws