code: @Override
      public final void sessionOpened(IoSession session) throws Exception {
          ProxyIoSession proxyIoSession = (ProxyIoSession) session
                  .getAttribute(ProxyIoSession.PROXY_SESSION);
  
          if (proxyIoSession.getRequest() instanceof SocksProxyRequest
                  || proxyIoSession.isAuthenticationFailed()
                  || proxyIoSession.getHandler().isHandshakeComplete()) {
              proxySessionOpened(session);
          } else {
              logger.debug("Filtered session opened event !");
          }
      }
docs: Hooked session opened event.
  
  @param session the io session