code: @Override
      public void sessionCreated(IoSession session) throws Exception {
          log.debug("Session created");
          // add rtmpe filter, rtmp protocol filter is added upon successful handshake
          session.getFilterChain().addFirst("rtmpeFilter", new RTMPEIoFilter());
          // create a connection
          RTMPMinaConnection conn = createRTMPMinaConnection();
          // set the session on the connection
          conn.setIoSession(session);
          // add the connection
          session.setAttribute(RTMPConnection.RTMP_SESSION_ID, conn.getSessionId());
          // create an outbound handshake, defaults to non-encrypted mode
          OutboundHandshake outgoingHandshake = new OutboundHandshake();
          // add the handshake
          session.setAttribute(RTMPConnection.RTMP_HANDSHAKE, outgoingHandshake);
          // setup swf verification
          if (enableSwfVerification) {
              String swfUrl = (String) handler.getConnectionParams().get("swfUrl");
              log.debug("SwfUrl: {}", swfUrl);
              if (!StringUtils.isEmpty(swfUrl)) {
                  outgoingHandshake.initSwfVerification(swfUrl);
              }
          }
          //if handler is rtmpe client set encryption on the protocol state
          //if (handler instanceof RTMPEClient) {
          //rtmp.setEncrypted(true);
          //set the handshake type to encrypted as well
          //outgoingHandshake.setHandshakeType(RTMPConnection.RTMP_ENCRYPTED);
          //}
          // set a reference to the handler on the sesssion
          session.setAttribute(RTMPConnection.RTMP_HANDLER, handler);
          // set a reference to the connection on the client
          handler.setConnection((RTMPConnection) conn);
          // set a connection manager for any required handling and to prevent memory leaking
          RTMPConnManager connManager = (RTMPConnManager) RTMPConnManager.getInstance();
          session.setAttribute(RTMPConnection.RTMP_CONN_MANAGER, new WeakReference<IConnectionManager<RTMPConnection>>(connManager));
      }
docs: {@inheritDoc}