Open-source multiplayer game server compatible with the RuneScape client https://www.openrs2.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
openrs2/game/src/main/kotlin/org/openrs2/game/net/http/HttpChannelInitializer.kt

27 lines
808 B

package org.openrs2.game.net.http
import io.netty.channel.Channel
import io.netty.channel.ChannelInitializer
import io.netty.handler.codec.http.HttpObjectAggregator
import io.netty.handler.codec.http.HttpRequestDecoder
import io.netty.handler.codec.http.HttpResponseEncoder
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
public class HttpChannelInitializer @Inject constructor(
private val handler: HttpChannelHandler
) : ChannelInitializer<Channel>() {
override fun initChannel(ch: Channel) {
ch.pipeline().addLast(
HttpRequestDecoder(),
HttpResponseEncoder(),
HttpObjectAggregator(MAX_CONTENT_LENGTH),
handler
)
}
private companion object {
private const val MAX_CONTENT_LENGTH = 65536
}
}