Search in sources :

Example 1 with JettyRequestUpgradeStrategy

use of org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy in project ma-core-public by infiniteautomation.

the class MangoWebSocketConfigurer method handshakeHandler.

@Bean
public DefaultHandshakeHandler handshakeHandler() {
    WebSocketPolicy policy = new WebSocketPolicy(WebSocketBehavior.SERVER);
    policy.setInputBufferSize(8192);
    // We don't want timeouts..
    policy.setIdleTimeout(Integer.MAX_VALUE);
    WebSocketServerFactory factory = new WebSocketServerFactory(policy);
    return new DefaultHandshakeHandler(new JettyRequestUpgradeStrategy(factory));
}
Also used : WebSocketPolicy(org.eclipse.jetty.websocket.api.WebSocketPolicy) JettyRequestUpgradeStrategy(org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy) WebSocketServerFactory(org.eclipse.jetty.websocket.server.WebSocketServerFactory) DefaultHandshakeHandler(org.springframework.web.socket.server.support.DefaultHandshakeHandler) Bean(org.springframework.context.annotation.Bean)

Aggregations

WebSocketPolicy (org.eclipse.jetty.websocket.api.WebSocketPolicy)1 WebSocketServerFactory (org.eclipse.jetty.websocket.server.WebSocketServerFactory)1 Bean (org.springframework.context.annotation.Bean)1 JettyRequestUpgradeStrategy (org.springframework.web.socket.server.jetty.JettyRequestUpgradeStrategy)1 DefaultHandshakeHandler (org.springframework.web.socket.server.support.DefaultHandshakeHandler)1