// since handshaking is done, replace the encoder/decoder with
// web socket data frame encoder/decoder
ChannelPipeline p = ctx.getChannel().getPipeline();
p.remove("aggregator");
EngineConfiguration config = engine.getConfiguration();
if (config == null || config.getMaxFramesize() == 0) {
p.replace("decoder", "jwsdecoder", new WebSocketFrameDecoder(JWebSocketCommonConstants.DEFAULT_MAX_FRAME_SIZE));
} else {
p.replace("decoder", "jwsdecoder", new WebSocketFrameDecoder(config.getMaxFramesize()));
}
p.replace("encoder", "jwsencoder", new WebSocketFrameEncoder());
//if the WebSocket connection URI is wss then start SSL TLS handshaking
if (req.getUri().startsWith("wss:")) {