strophejs
strophejs copied to clipboard
Document Node.js Version Support for Protocols
Clearly state the Node.js versions that support the various protocols. Currently, the Node.js environment lacks support for XMLHttpRequest, which prevents the use of BOSH connections. This limitation affects the ability to establish XMPP connections using BOSH.
I think this code works correctly:
_newXHR() {
const xhr = (typeof window.XMLHttpRequest !== 'undefined') ? new XMLHttpRequest() : new (require('xmlhttprequest').XMLHttpRequest)();
}
Using polyfills in Rollup to add compatibility support is also a good option.