xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.18k stars 371 forks source link

Ability to disable HTTP resolution #944

Closed JorgenPhi closed 1 year ago

JorgenPhi commented 2 years ago

Is your feature request related to a problem? Please describe. I am connecting to a host that does not have an HTTP service. When trying to resolve over HTTP, the client hangs and waits until the connection times out before continuing.

Describe the solution you'd like A way to disable the HTTP resolution.

sonnyp commented 1 year ago

the client hangs and waits until the connection times out before continuing.

For how long?

If they don't have any HTTP service, there shouldn't be any hang – just a quick and simple connection refused.

In general we avoid options on @xmpp/client which is meant to be a standard client for all. Unless you believe this bug affect others, please use a custom client and discard what you don't need.

https://github.com/xmppjs/xmpp.js/blob/main/packages/client/index.js

One option here would be to omit const _resolve = require("@xmpp/resolve"); and use a direct xmpp uri instead of hostname.