Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Node.js Version Support for Protocols #766

Open
jinyu2022 opened this issue Nov 30, 2024 · 2 comments
Open

Document Node.js Version Support for Protocols #766

jinyu2022 opened this issue Nov 30, 2024 · 2 comments

Comments

@jinyu2022
Copy link

jinyu2022 commented Nov 30, 2024

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
Copy link
Author

I think this code works correctly:

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

@jinyu2022
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant