strophejs icon indicating copy to clipboard operation
strophejs copied to clipboard

Document Node.js Version Support for Protocols

Open jinyu2022 opened this issue 1 year ago • 2 comments

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.

jinyu2022 avatar Nov 30 '24 09:11 jinyu2022

I think this code works correctly:

_newXHR() {
    const xhr = (typeof window.XMLHttpRequest !== 'undefined') ? new XMLHttpRequest() : new (require('xmlhttprequest').XMLHttpRequest)();
}

jinyu2022 avatar Nov 30 '24 09:11 jinyu2022

Using polyfills in Rollup to add compatibility support is also a good option.

jinyu2022 avatar Nov 30 '24 09:11 jinyu2022