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

com.github.masahitojp.botan.router.HttpRouterServerInitializer Maven / Gradle / Ivy

There is a newer version: 0.6.4
Show newest version
package com.github.masahitojp.botan.router;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.codec.http.BadClientSilencer;
import io.netty.handler.codec.http.router.Router;

/**
 *
 */
public class HttpRouterServerInitializer extends ChannelInitializer {
	private final HttpRouterServerHandler handler;
	private final BadClientSilencer badClientSilencer = new BadClientSilencer();

	public HttpRouterServerInitializer(final Router router) {
		handler = new HttpRouterServerHandler(router);
	}

	@Override
	public void initChannel(final SocketChannel ch) {
		ch.pipeline()
				.addLast(new HttpServerCodec())
				.addLast(handler)
				.addLast(badClientSilencer);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy