code: private ProxyLogicHandler getProxyHandler(final IoSession session) {
          ProxyLogicHandler handler = ((ProxyIoSession) session
                  .getAttribute(ProxyIoSession.PROXY_SESSION)).getHandler();
  
          if (handler == null) {
              throw new IllegalStateException();
          }
  
          // Sanity check
          if (handler.getProxyIoSession().getProxyFilter() != this) {
              throw new IllegalArgumentException("Not managed by this filter.");
          }
  
          return handler;
      }
docs: Get the {@link ProxyLogicHandler} for a given session.
  
  @param session the session object
  @return the handler which will handle handshaking with the proxy