@Override
    protected void createSession(String serverName, XmlPullParser xpp, Connection connection) throws XmlPullParserException
    {
        // This largely copies LocalClientSession#createSession, with modifications that are specific to websockets.
        if (!LocalClientSession.isAllowed(connection))
        {
            // Client cannot connect from this IP address so end the stream and TCP connection.
            String hostAddress = "Unknown";
            try {
                hostAddress = connection.getHostAddress();
            } catch (UnknownHostException e) {
                // Do nothing
            }

            Log.debug("Closed connection to client attempting to connect from: {}", hostAddress);
            // Include the not-authorized error in the response and close the underlying connection.
            connection.close(new StreamError(StreamError.Condition.not_authorized));
            return;
        }

        // Retrieve list of namespaces declared in current element (OF-2556)
        connection.setAdditionalNamespaces(XMPPPacketReader.getPrefixedNamespacesOnCurrentElement(xpp));

        final Locale language = Session.detectLanguage(xpp);

        connection.setXMPPVersion(1, 0);

        // Create a ClientSession for this user.
        session = SessionManager.getInstance().createClientSession(connection, language);
        session.setSessionData("ws", Boolean.TRUE);

        openStream();
        sendStreamFeatures();
    }
A {@link org.jivesoftware.openfire.net.StanzaHandler} that is able to process the specific framing that is used by
clients connecting via websockets.

@author Guus der Kinderen, guus@goodbytes.nl
@see <a href="https://www.rfc-editor.org/rfc/rfc7395.html">RFC 7395:  An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket</a>
xmppserver/src/main/java/org/jivesoftware/openfire/websocket/WebSocketClientStanzaHandler.java