https://github.com/jsxc/xmpp-connection-discovery-node
:mag: Use RFC6120 and XEP-0156 to get XMPP connection services
https://github.com/jsxc/xmpp-connection-discovery-node
Last synced: about 12 hours ago
JSON representation
:mag: Use RFC6120 and XEP-0156 to get XMPP connection services
- Host: GitHub
- URL: https://github.com/jsxc/xmpp-connection-discovery-node
- Owner: jsxc
- License: mit
- Created: 2018-01-24T09:29:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-06T02:08:23.000Z (over 5 years ago)
- Last Synced: 2025-02-15T14:24:18.098Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/xmpp-connection-discovery)
# XMPP connection discovery
:mag: Use RFC6120 and XEP-0156 to discover XMPP connection services.
## Features
- [Query SRV records](https://tools.ietf.org/html/rfc6120#section-3.2.1)
- [Query TXT records](https://xmpp.org/extensions/xep-0156.html#dns)
- [Query Host Metadata](https://xmpp.org/extensions/xep-0156.html#http)
## How to use
Install this module as usual with `yarn add xmpp-connection-discovery` and import the script:
```
const discoverXMPPServices = require('xmpp-connection-discovery');
```
Discover TCP, websocket and BOSH services like this:
```
discoverXMPPServices('your.domain').then((services) => {
console.log(services);
/* { tcp: [ { server: 'xmpp.your.domain', port: 5222 } ],
xbosh: [ { server: 'https://xmpp.your.domain:5280/http-bind' } ] } */
})
```