Websocket over Spring Netflix Zuul

Regarding this issue: https://github.com/spring-cloud/spring-cloud-netflix/issues/163 is there a reasonable way to configure Spring's reverse Zuul Cloud proxy for use with websites?

I managed to configure the proxy server on the websocket endpoint and successfully connect to it with the client, but due to very short timeouts, the connections are constantly closed. At the moment, I am most concerned about the auto-discovery of the Zuul service. Does it make sense to try to use a similar workaround, for example, to download the files described in the link, although with large connection timeouts?

Are there any reasonable alternatives? How to write my own ZuulFilter?

+4
source share
2 answers

Since there is no answer, this is what I was able to learn about using Zuul with WebSockets.

My question was inaccurate in the sense that I used Sock.js, and when connecting through Zuul Sock.js it turned out:

405 - Bad request

which immediately dropped it on xhr-straming, and this is when it was able to establish a connection, therefore

Cannot use Websocket protocol overriding Zuul.

But still, I encountered a second problem, even when I managed to connect using the Sock.js backup transport, the connection was constantly closed by the proxy. Fortunetly Sock.js requires that the server “send” audible calls every 10 seconds (by default), so by setting the tape and hysteresis timeouts, you can maintain a “Sock.js connection” without special re-enable logic. As described in the link:

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 60000 tape: ConnectTimeout: 3000 ReadTimeout: 60000

I set these timeouts to double the usage time of Sock.js - so 20 seconds.

However, this is not native Websocket support.

I'm still looking for a reasonable replacement for the Zuul proxy or some recommendations on what other steps I could take to complete this work.

+7
source

We considered this problem, we have a similar requirement for proxy connections through a website through a zuul server. The requirement is slightly different, because connecting to websites will be “special” and will not need to be handled in the same way as other requests that come through zuul.

Previously, this was very easy to achieve with nodejs and http-proxy. This is an example of how to get started in java and Spring Boot: https://github.com/barrett-rob/java-websocket-reverse-proxy

NB: no security, reconnection, etc.

0
source

All Articles