[FEATURE] Netty maxWebSocketRequestBytes

This commit is contained in:
Gravit 2020-11-21 20:33:10 +07:00
parent ae2ef5e7c2
commit 5e048905cc
No known key found for this signature in database
GPG key ID: 98A079490768CCE5
2 changed files with 2 additions and 1 deletions

View file

@ -313,6 +313,7 @@ public static class NettyPerformanceConfig {
public int bossThread;
public int workerThread;
public long sessionLifetimeMs = 24 * 60 * 60 * 1000;
public int maxWebSocketRequestBytes = 1024 * 1024;
}
public static class NettyBindAddress {

View file

@ -56,7 +56,7 @@ public void initChannel(SocketChannel ch) {
NettyConnectContext context = new NettyConnectContext();
//p.addLast(new LoggingHandler(LogLevel.INFO));
pipeline.addLast("http-codec", new HttpServerCodec());
pipeline.addLast("http-codec-compressor", new HttpObjectAggregator(65536));
pipeline.addLast("http-codec-compressor", new HttpObjectAggregator(server.config.netty.performance.maxWebSocketRequestBytes));
if (server.config.netty.ipForwarding)
pipeline.addLast("forward-http", new NettyIpForwardHandler(context));
pipeline.addLast("websock-comp", new WebSocketServerCompressionHandler());