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

jp.co.cyberagent.aeromock.server.AeromockServerInitializer.scala Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package jp.co.cyberagent.aeromock.server

import io.netty.channel.ChannelInitializer
import io.netty.channel.socket.SocketChannel
import io.netty.handler.codec.http.HttpObjectAggregator
import io.netty.handler.codec.http.HttpRequestDecoder
import io.netty.handler.codec.http.HttpResponseEncoder
import io.netty.handler.stream.ChunkedWriteHandler

class AeromockServerInitializer extends ChannelInitializer[SocketChannel] {

  override def initChannel(channel: SocketChannel) {
    channel.pipeline()
      .addLast("decoder", new HttpRequestDecoder)
      .addLast("aggregator", new HttpObjectAggregator(65536))
      .addLast("encoder", new HttpResponseEncoder)
      .addLast("chunkedWriter", new ChunkedWriteHandler)
      .addLast("handler", new AeromockServerHandler(true))
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy