Constructor
new Connection(service, options)
Create and initialize a Strophe.Connection object.
The transport-protocol for this connection will be chosen automatically based on the given service parameter. URLs starting with "ws://" or "wss://" will use WebSockets, URLs starting with "http://", "https://" or without a protocol will use BOSH.
To make Strophe connect to the current host you can leave out the protocol and host part and just pass the path:
const conn = new Strophe.Connection("/http-bind/");
Parameters:
Name | Type | Description |
---|---|---|
service |
string | The BOSH or WebSocket service URL. |
options |
ConnectionOptions | A object containing configuration options |
Members
_data
_sasl_data :SASLData
Type:
addHandlers :Array.<Handler>
Type:
- Array.<Handler>
addTimeds :Array.<TimedHandler>
Type:
- Array.<TimedHandler>
handlers :Array.<Handler>
Type:
- Array.<Handler>
mechanisms :Object.<string, SASLMechanism>
Type:
- Object.<string, SASLMechanism>
removeHandlers :Array.<Handler>
Type:
- Array.<Handler>
removeTimeds :Array.<TimedHandler>
Type:
- Array.<TimedHandler>
timedHandlers :Array.<TimedHandler>
Type:
- Array.<TimedHandler>