Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket connection fails when request and websocket paths are different #2

Open
afourmi opened this issue May 15, 2017 · 1 comment

Comments

@afourmi
Copy link

afourmi commented May 15, 2017

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:

zuul:
  routes:
    websocket:
      path: /ws/**
      url: http://localhost:10008
      customSensitiveHeaders: true
  ws:
     brokerages:
       websocket:
         end-points: /mywebsocket
         brokers:  /topic
         destination-prefixes: /

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.

@mthizo247
Copy link
Owner

@afourmi thanks, I will look at this scenario as soon as i get a gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants