   (-> req (.handler) (.hijack req ignore-nginx-filter?)))
 
 (defprotocol HttpServerChannel
+  (closed? [ch])
   (close! [ch] 
     "Asynchronously close the channel. If there's remaining data to send it won't block 
      current thread  and will flush data on the background asynchronously and later close the channel safely")

            NginxRequest NginxHttpServerChannel ChannelListener
            AppEventListenerManager AppEventListenerManager$Listener
            AppEventListenerManager$Decoder AppEventListenerManager$PostedEvent
            MessageAdapter])
  (:import [nginx.clojure.net NginxClojureAsynChannel NginxClojureAsynChannel$CompletionListener
            NginxClojureAsynSocket])
  (:import [nginx.clojure.clj Constants])

                          (onOpen [c] (if on-open (on-open c)))
                          (onTextMessage [c msg rem?] (if on-message (on-message c msg rem?)))
                          (onBinaryMessage [c msg rem?] (if on-message (on-message c msg rem?)))
                          (onClose ;([c] (if on-close (on-close c "0")))
                                   ([c status reason] (if on-close (on-close c (str status ":" reason)))))
                          (onError [c status] (if on-error (on-error c (NginxClojureAsynSocket/errorCodeToString status)))))))
  (add-aggregated-listener! [ch max-message-size {:keys [on-open on-message on-close on-error]}]
    (.addListener ch ch (proxy [WholeMessageAdapter] [max-message-size]
                          (onOpen [c] (if on-open (on-open c)))
                          (onWholeTextMessage [c msg] (if on-message (on-message c msg)))
                          (onWholeBiniaryMessage [c msg rem?] (if on-message (on-message c msg)))
                          (onClose ;([c] (if on-close (on-close c "0")))
                                   ([c status reason] (if on-close (on-close c (str status ":" reason)))))
                          (onError [c status] (if on-error (on-error c (NginxClojureAsynSocket/errorCodeToString status)))))))
