promise.setFailure(
new IllegalStateException("No HttpDecoder and no HttpServerCodec in the pipeline"));
return;
}
p.addBefore(ctx.name(), "wsencoder", newWebsocketDecoder());
p.replaceAndForward(ctx.name(), "wsdecoder", newWebSocketEncoder());
} else {
p.replaceAndForward(ctx.name(), "wsdecoder", newWebsocketDecoder());
p.replace(HttpResponseEncoder.class, "wsencoder", newWebSocketEncoder());
}