Question

I'm using Vaadin 7.1.2 on a OpenShift instance (RedHat).

OpenShift offers a node.js proxy which should be compatible with WebSocket, but the WebSocket connections get closed immediately after they have been open with no error message (Vaadin just display "connection closed", "wasclean:true", "reason:").

Because there is no error then Vaadin/Atmosphere doesn't fall back to the streaming mode and instead continues to open Websocket once every two seconds.

I'm looking for a way to disable websocket in Vaadin/atmosphere altogether and enable streaming instead.

Was it helpful?

Solution

You can disable websockets and enforce streaming by using the following annotation in your UI class:

@Push(transport = Transport.STREAMING)
public class PushUI extends UI {
    ...
}

OTHER TIPS

Nowadays the STREAMING transport is deprecated with all Vaadin versions. You should use

@Push(transport = Transport.LONG_POLLING)

instead to use normal HTTP instead of WebSockets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top