Unfiltered Netty with

21 views
Skip to first unread message

Crazy Frog

unread,
Aug 22, 2014, 5:10:54 AM8/22/14
to unfilter...@googlegroups.com
I am on version 0.8.1

I have a problem with netty and content compression. 

The following code does not compress anything from resources().

    val binding = SocketBinding(port, "localhost")

    unfiltered.netty.Server.bind(binding)
      .handler(
        new ChannelInitializer[SocketChannel] {
          def initChannel(channel: SocketChannel) =
            channel.pipeline
              .addAfter("handler-1", "compressor", new HttpContentCompressor) // hack!
        }
      )
      .chunked(1048576)
      .resources(getClass.getResource("/public"))
      .plan(Planify {

        case req =>
          implicit val r = req
          reply(r)

      })

How would I achieve content compression of resources under /public ?

Thanks.
Reply all
Reply to author
Forward
0 new messages