code: public void upgradeServerPipelineFactory(ChannelPipeline p, String wsVersion) {
  		if (p.get(HttpChunkAggregator.class) != null) {
  			p.remove(HttpChunkAggregator.class);
  		}
  
  		p.get(HttpRequestDecoder.class).replace("wsdecoder",
  				new WebSocket13FrameDecoder(true, true, Long.MAX_VALUE));
  		p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket13FrameEncoder(false));		
  	}
docs: Upgrade the Server ChannelPipelineFactory. This method should be called from the HttpResponseHandler.messageReceived(ChannelHandlerContext, MessageEvent)
  when the handler detects that the response contains WebSocket header "Sec-WebSocket-Protocol"
  
  @param ChannelPipeline p
  @param String WebSocket version