All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.jooby.internal.netty.NettyWebSocketCompressor Maven / Gradle / Ivy

The newest version!
/*
 * Jooby https://jooby.io
 * Apache License Version 2.0 https://jooby.io/LICENSE.txt
 * Copyright 2014 Edgar Espina
 */
package io.jooby.internal.netty;

import io.netty.handler.codec.compression.ZlibCodecFactory;
import io.netty.handler.codec.http.websocketx.extensions.WebSocketServerExtensionHandler;
import io.netty.handler.codec.http.websocketx.extensions.compression.DeflateFrameServerExtensionHandshaker;
import io.netty.handler.codec.http.websocketx.extensions.compression.PerMessageDeflateServerExtensionHandshaker;

public class NettyWebSocketCompressor extends WebSocketServerExtensionHandler {
  public NettyWebSocketCompressor(int compressionLevel) {
    super(
        new PerMessageDeflateServerExtensionHandshaker(
            compressionLevel,
            ZlibCodecFactory.isSupportingWindowSizeAndMemLevel(),
            PerMessageDeflateServerExtensionHandshaker.MAX_WINDOW_SIZE,
            false,
            false),
        new DeflateFrameServerExtensionHandshaker(compressionLevel));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy