If the websocket is exposed on a different path than the path request, the websocket connection will fail.
In the following case, the websocket is exposed on http://localhost:10008/my-websocket
And there is a zuul proxy with the following config:
When the client connects to websocket with the url http://proxy/ws/mywebsocket, the zuul proxy does not route the call to localhost:10008
If I change the route configuration to reflect the route path:
end-points: /ws/mywebsocket
Then the websocket connection fails again with the following message:
c.g.m.c.n.z.web.socket.ProxyWebSocketConnectionManager | Error connecting to web socket uri http://localhost:10008/ws/mywebsocket
There is a workaround to this problem, by setting both request path and websocket paths in the end-points parameter:
end-points: mywebsocket,ws/mywebsocket
Doing this, the previous message (Error connecting to web socket uri...) still appears, but the web socket connection succeeds. I guess that the endpoints are tried in order.
There should be a way to route web sockets calls, even if path differs betwen request path and host path.
If the websocket is exposed on a different path than the path request, the websocket connection will fail. In the following case, the websocket is exposed on http://localhost:10008/my-websocket And there is a zuul proxy with the following config:
When the client connects to websocket with the url http://proxy/ws/mywebsocket, the zuul proxy does not route the call to localhost:10008 If I change the route configuration to reflect the route path:
Then the websocket connection fails again with the following message:
c.g.m.c.n.z.web.socket.ProxyWebSocketConnectionManager | Error connecting to web socket uri http://localhost:10008/ws/mywebsocket
There is a workaround to this problem, by setting both request path and websocket paths in the end-points parameter:
Doing this, the previous message (Error connecting to web socket uri...) still appears, but the web socket connection succeeds. I guess that the endpoints are tried in order.
There should be a way to route web sockets calls, even if path differs betwen request path and host path.