1
votes

I'm trying to distinguish a new connection as an HTTP or framer/string based connection using Netty and I want to use the same server port for both. For now I simply look for "GET " etc. in the first line. However, when using a DelimiterBasedFrameDecoder, I keep receiving String contents even when decoders and encoders are replaced with the HTTP ones. I tryed overriding handleUpstream, messageReceived, fireing events and converting lost messages back to channelbuffers etc. but I had no luck. I also tried to implement a single handler that looks into the first received channelbuffer but I am not able to create a working pipeline afterwards.

Any suggestions?

1

1 Answers

1
votes

Have a look on port unification example. You don't have to start from scratch, just modify the PortUnificationServerHandler based on your content type or protocol and add your string protocol encoder/decoders there.