websocket sockJS connection on spring cloud gateway eurekaproblem

31 Views Asked by At

I have microservice architecture which works on spring cloud API gateway with eureka instances as clients and i need some help with forwarding websocket connection

enter image description here

While connecting to websocket service directly through localhost on port 8085 everything is working:

const socket = new SockJS('http://localhost:8085/websocket');

When I try to connect through API gateway on localhost port 8083 there is a connection error:

const socket = new SockJS('http://localhost:8083/websocket');

API gateway routing :

enter image description here

I tried a lot of combination also

.uri("lb://messaging-service:8085"))
.uri("ws://messaging-service:8085"))

Websocket configuration :

enter image description here

enter image description here

Error:

enter image description here

Tried everything with allowing headers, some diffrent cases on websocket URL etc.

0

There are 0 best solutions below