@OnWebSocketMessage
    public void onTextMethod(String stanza)
    {
        lastReceived = Instant.now();

        XMPPPacketReader reader = null;
        try {
            reader = readerPool.borrowObject();

            if (STREAM_SUBSTITUTION_ENABLED.getValue()) {
                // Allow clients that do websockets without the required XMPP framing to connect. See https://igniterealtime.atlassian.net/browse/OF-2479
                if (stanza.startsWith("<?xml version='1.0'?><stream:stream ")) {
                    stanza = stanza.replace("<?xml version='1.0'?><stream:stream ", "<open ");
                    stanza = stanza.replace("jabber:client", "urn:ietf:params:xml:ns:xmpp-framing");
                    stanza += "</open>";
                }
                if (stanza.startsWith("</stream:stream>")) {
                    stanza = stanza.replace("</stream:stream>", "<close xmlns='urn:ietf:params:xml:ns:xmpp-framing' />");
                }
            }

            try {
                final StanzaHandler handler = wsConnection.getStanzaHandler();
                handler.process(stanza, reader);
            } catch (Throwable e) { // Make sure to catch Throwable, not (only) Exception! See OF-2367
                Log.error("Closing connection due to error while processing stanza: {}", stanza, e);
                if ( wsConnection != null ) {
                    wsConnection.close(new StreamError(StreamError.Condition.internal_server_error, "An error occurred while processing data raw inbound data."));
                }
            }
        } catch (Exception ex) {
            Log.error("Failed to process XMPP stanza", ex);
        } finally {
            if (reader != null) {
                readerPool.returnObject(reader);
            }
        }
    }
Controls if clients that do websockets without the required XMPP framing will get their 'stream' element names
replaced, so that they are able to connect.

@see <a href="https://igniterealtime.atlassian.net/browse/OF-2479">OF-2479: Allow Tsung to test with websockets</a>
xmppserver/src/main/java/org/jivesoftware/openfire/websocket/WebSocketClientConnectionHandler.java