code: public boolean isWebSocketClosing(HttpRequest request) {
          Channel channel = getWebSocketChannel(request);
          if (channel != null && channel.getParent() != null) {
              WebSocketCompositeChannel parent = (WebSocketCompositeChannel)channel.getParent();
              if (parent != null) {
                  return parent.getReadyState() == ReadyState.CLOSED || parent.getReadyState() == ReadyState.CLOSING;
              }
          }
          return false;
      }
docs: parameter: channel - WebSockectEmulatedChannel