Converse converse.js

Namespace: Strophe

Strophe

A container for all Strophe library functions.

This object is a container for all the objects and constants used in the library. It is not meant to be instantiated, but to provide a namespace for library objects, constants, and functions.

Properties:
Name Type Default Description
Handler Handler
Builder Builder
Request Request

Represents HTTP Requests made for a BOSH connection

Bosh Bosh

Support for XMPP-over-HTTP via XEP-0124 (BOSH)

Websocket Websocket

Support for XMPP over websocket

WorkerWebsocket WorkerWebsocket

Support for XMPP over websocket in a shared worker

TIMEOUT number 1.1

Timeout multiplier. A waiting BOSH HTTP request will be considered failed after Math.floor(TIMEOUT * wait) seconds have elapsed. This defaults to 1.1, and with default wait, 66 seconds.

SECONDARY_TIMEOUT number 0.1

Secondary timeout multiplier. In cases where Strophe can detect early failure, it will consider the request failed if it doesn't return after Math.floor(SECONDARY_TIMEOUT * wait) seconds have elapsed. This defaults to 0.1, and with default wait, 6 seconds.

SASLAnonymous SASLAnonymous

SASL ANONYMOUS authentication.

SASLPlain SASLPlain

SASL PLAIN authentication

SASLSHA1 SASLSHA1

SASL SCRAM-SHA-1 authentication

SASLSHA256 SASLSHA256

SASL SCRAM-SHA-256 authentication

SASLSHA384 SASLSHA384

SASL SCRAM-SHA-384 authentication

SASLSHA512 SASLSHA512

SASL SCRAM-SHA-512 authentication

SASLOAuthBearer SASLOAuthBearer

SASL OAuth Bearer authentication

SASLExternal SASLExternal

SASL EXTERNAL authentication

SASLXOAuth2 SASLXOAuth2

SASL X-OAuth2 authentication

Status Status
NS Object.<string, string>
XHTML XHTML
Source:

Classes

Connection
TimedHandler

Methods

(static) copyElement(node) → {Element|Text}

Copy an XML DOM element.

This function copies a DOM element and all its descendants and returns the new copy.

Parameters:
Name Type Description
node Node

A DOM element.

Source:
Returns:
  • A new, copied DOM element tree.
Type
Element | Text

(static) createHtml(elem) → {Node}

Copy an HTML DOM Element into an XML DOM. This function copies a DOM element and all its descendants and returns the new copy.

Parameters:
Name Type Description
elem HTMLElement

A DOM element.

Source:
Returns:
  • A new, copied DOM element tree.
Type
Node

(static) createHtml(node) → {Node}

Copy an HTML DOM Node into an XML DOM. This function copies a DOM element and all its descendants and returns the new copy.

Parameters:
Name Type Description
node Node

A DOM element.

Source:
Returns:
  • A new, copied DOM element tree.
Type
Node

(static) escapeNode(node) → {string}

Escape the node part (also called local part) of a JID.

Parameters:
Name Type Description
node string

A node (or local part).

Source:
Returns:

An escaped node (or local part).

Type
string

(static) forEachChild(elem, elemName, func)

Map a function over some or all child elements of a given element.

This is a small convenience function for mapping a function over some or all of the children of an element. If elemName is null, all children will be passed to the function, otherwise only children whose tag names match elemName will be passed.

Parameters:
Name Type Description
elem Element

The element to operate on.

elemName string

The child element tag name filter.

func function

The function to apply to each child. This function should take a single argument, a DOM element.

Source:

(static) getBareJidFromJid(jid) → {string}

Get the bare JID from a JID String.

Parameters:
Name Type Description
jid string

A JID.

Source:
Returns:
  • A String containing the bare JID.
Type
string

(static) getDomainFromJid(jid) → {string}

Get the domain portion of a JID String.

Parameters:
Name Type Description
jid string

A JID.

Source:
Returns:
  • A String containing the domain.
Type
string

(static) getNodeFromJid(jid) → {string}

Get the node portion of a JID String.

Parameters:
Name Type Description
jid string

A JID.

Source:
Returns:
  • A String containing the node.
Type
string

(static) getResourceFromJid(jid) → {string}

Get the resource portion of a JID String.

Parameters:
Name Type Description
jid string

A JID.

Source:
Returns:
  • A String containing the resource.
Type
string

(static) getText(elem) → {string}

Get the concatenation of all text children of an element.

Parameters:
Name Type Description
elem Element

A DOM element.

Source:
Returns:
  • A String with the concatenated text of all text element children.
Type
string

(static) isTagEqual(el, name) → {boolean}

Compare an element's tag name with a string. This function is case sensitive.

Parameters:
Name Type Description
el Element

A DOM element.

name string

The element name.

Source:
Returns:

true if the element's tag name matches el, and false otherwise.

Type
boolean

(static) serialize(elem) → {string}

Render a DOM element and all descendants to a String.

Parameters:
Name Type Description
elem Element | Builder

A DOM element.

Source:
Returns:
  • The serialized element tree as a String.
Type
string

(static) unescapeNode(node) → {string}

Unescape a node part (also called local part) of a JID.

Parameters:
Name Type Description
node string

A node (or local part).

Source:
Returns:

An unescaped node (or local part).

Type
string

(static) xmlescape(text) → {string}

Excapes invalid xml characters.

Parameters:
Name Type Description
text string

text to escape.

Source:
Returns:
  • Escaped text.
Type
string

(static) xmlunescape(text) → {string}

Unexcapes invalid xml characters.

Parameters:
Name Type Description
text string

text to unescape.

Source:
Returns:
  • Unescaped text.
Type
string