WebSockets¶
App Suite Proxy provides a way to handle WebSockets to support bidirectional real-time communication between client and server. Therefor the Proxy runtime can establish a tunnel between a client and a backend server. The client needs to simply send a valid WebSocket handshake request and if backend server accepts the handshake the tunnel will be opened.
Configuration¶
The settings to setup WebSockets needs to be done in application.properties and routing.yml
application.properties:
- proxy.websockets.enabled
Manadatory for WebSockets: Enable WebSockets
Default:
falseReloadable:
falseEnvVar:
PROXY_WEBSOCKETS_ENABLED- proxy.websockets.port.offset
Optional: If WebSockets are enabled the given value can be used to start proxy with a dedicated port on which WebSockets are supported. The concrete port depends on the settings for
zuul.server.port.mainandproxy.tls.port. E.g. ifproxy.tls.portis8443andproxy.websockets.port.offsetis10the WebSocket port will be8453. This allows a dedicated management where request on port8453allow HTTPS as well as WebSockets but request on8443only allow plain HTTPS.Default:
0Reloadable:
falseEnvVar:
PROXY_WEBSOCKETS_PORT_OFFSET- proxy.websockets.port.offset
Optional: If WebSockets are enabled the given value can be used to override the settings in routing and backend configuration and set the timeout for all WebSocket connections. If set to 0 proxy will never close a connection no matter how long there was no read or write operation on opened connection. If set to -1 this property is disabled and the configuration in routing / backend will be used.
Default:
-1Reloadable:
trueEnvVar:
PROXY_WEBSOCKETS_GLOBAL_TIMEOUT
routing.yml:
WebSockets needs a specific action type. This enables the proxy to deal with incoming handshake requests. See section WebSocket tunnel in Routing Action.