search close

Installing the Java Module as a Netty Handler

access_time Updated Jun 29, 2022

The Signal Sciences Netty module is implemented as a handler which inspects HttpRequest events before forwarding the event to the next handler in the pipeline.


  1. Download the Java module archive from:

  2. Extract sigsci-module-java_latest.tar.gz.

  3. There are two options for deploying the jars:

    • Copy sigsci-module-java-{version}-shaded.jar (an uber jar with all the dependencies bundled) to your application’s classpath (e.g., %CATALINA_HOME%\webbapps\<APP_FOLDER>\WEB-INF\lib).

    • Copy sigsci-module-java-{version}.jar and its dependencies in the lib folder to your application’s classpath (e.g., %CATALINA_HOME%\webbapps\<APP_FOLDER>\WEB-INF\lib). If you already have any of the dependency jar files in your application classpath folder (i.e., for Tomcat in the WEB-INF\lib) then it is not necessary to copy them, even if the version numbers are different. The logging jars are optional based on how slf4j is configured.

For Java projects using Maven for build or deployment, the Signal Sciences Java modules can be installed by adding the following to the project pom.xml:



Install and configure

Create a new instance of WafHandler for every new connection.

  • WafHandler must be added after FlowControlHandler.
  • HttpObjectAggregator handler should be added before FlowControlHandler to inspect HTTP Post body.
  • WafHandler may send HttpResponse for blocked request.

Example deployment

// Update configuration

// start server and handle requests
new ServerBootstrap()
.group(bossGroup, workerGroup)
  new ChannelInitializer<SocketChannel>() {
      public void initChannel(SocketChannel ch) throws Exception {
    .addLast(new HttpServerCodec())
    .addLast(new HttpObjectAggregator(6 * (1 << 20)))
    .addLast(new FlowControlHandler())
    .addLast("waf", new WafHandler())
    .addLast(new SimpleChannelInboundHandler<FullHttpRequest>() {

      // send response