# @xmpp/resolve

> XMPP connection methods resolution for JavaScript

Latest version **0.14.0** (published 2025-10-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @xmpp/resolve
pnpm add @xmpp/resolve
yarn add @xmpp/resolve
bun add @xmpp/resolve
```

## Health

**Score 58/100 (C)** — status: stable.

Positive: has types package; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.14.0 |
| Published | 2025-10-29 |
| First published | 2017-01-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/xmpp__resolve) |
| Module format | ESM + CommonJS |
| Node | >= 20.10 |
| Dependencies | 2 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2274 |
| Maintainers | sonny |
| Keywords | XMPP, dns, records, srv, txt, lookup, resolve |

## Links

- npm: https://www.npmjs.com/package/@xmpp/resolve
- Repository: https://github.com/xmppjs/xmpp.js
- Homepage: https://github.com/xmppjs/xmpp.js/tree/main/packages/resolve
- Issues: http://github.com/xmppjs/xmpp.js/issues
- npm.io page: https://npm.io/package/@xmpp/resolve

## Dependencies (2)

- [@xmpp/xml](https://npm.io/package/@xmpp/xml.md) ^0.14.0
- [@xmpp/events](https://npm.io/package/@xmpp/events.md) ^0.14.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.14.0 (latest) — 2025-10-29
- 0.13.3 — 2024-12-23
- 0.13.1 — 2022-02-13
- 0.13.0 — 2021-08-28
- 0.12.1 — 2021-08-22
- 0.12.0 — 2020-12-21
- 0.11.0 — 2020-02-14
- 0.10.0 — 2020-02-07
- 0.9.2 — 2020-01-02
- 0.9.1 — 2019-11-23
- 0.9.0 — 2019-11-19
- 0.8.0 — 2019-10-06
- 0.7.4 — 2019-06-15
- 0.7.1 — 2019-04-19
- 0.7.0 — 2019-02-03
- … 10 more at https://npm.io/package/@xmpp/resolve/versions

## README

# resolve

XMPP connection methods resolution for JavaScript

`@xmpp/resolve` retrieves and sorts possible XMPP endpoints using DNS and HTTP Web Host Metadata.

## Install

```
npm install @xmpp/resolve
```

## Usage

```javascript
import resolve from "@xmpp/resolve";

// optional
const options = {
  srv: [{ service: "xmpp-client", protocol: "tcp" }], // SRV records
  family: undefined, // IP version; 4, 6 or undefined for both
};

resolve("jabberfr.org", options).then(console.log).catch(console.error);
```

```javascript
[
  {
    address: "93.113.206.189",
    family: 4,
    name: "xmppjs.org",
    port: 5222,
    priority: 5,
    weight: 0,
  },
  {
    address: "2a03:75c0:39:3458::1",
    family: 6,
    name: "xmppjs.org",
    port: 5222,
    priority: 5,
    weight: 0,
  },
  { address: "93.113.206.189", family: 4 },
  { address: "2a03:75c0:39:3458::1", family: 6 },
  {
    attribute: "_xmpp-client-websocket",
    uri: "wss://xmppjs.org:443/websocket",
  },
  {
    attribute: "_xmpp-client-xbosh",
    uri: "https://xmppjs.org:443/bosh",
  },
];
```

## References

- [RFC 6120 Resolution of Fully Qualified Domain Names](https://xmpp.org/rfcs/rfc6120.html#tcp-resolution)
- [XEP-0156: Discovering Alternative XMPP Connection Methods](https://xmpp.org/extensions/xep-0156.html)
- [XEP-0368: SRV records for XMPP over TLS](https://xmpp.org/extensions/xep-0368.html)
- [RFC 6415 Web Host Metadata](https://tools.ietf.org/html/rfc6415)
- [DNS configuration in Jabber/XMPP](https://prosody.im/doc/dns)
- [https://wiki.xmpp.org/web/SRV_Records](https://wiki.xmpp.org/web/SRV_Records)

---
_Source: https://npm.io/package/@xmpp/resolve · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
