0

Opening a websocket without a port specified seems to fail on all xmpp servers. I assume this means there is no default websocket port.

I have been able to only open one xmpp server's websocket. It does not appear other xmpp servers use the same 5291 websocket port as tigase.im

How do you determine the websocket port for a public XMPP server? The lists of open xmpp servers seem to only give a url.

I at first tried DNS SRV lookup using DNSchecker.org which showed no SRV record.

As I learned more about DNS SRV lookup formats by reading RFC 6120, I found I can get the tcp port using mxtoolbox.com with the string: _xmpp-client._tcp.tigase.im

On a hunch, I tried _xmpp-client._websocket.tigase.im, but no port was returned. On further reading, the IETF specified to try the string _ws._tcp.tigase.im which also returned nothing using mxtoolbox.com Is there a different string I should be using with mxtoolbox.com?

Is there another way to get the websocket port number of a public XMPP server?

4

2 回答 2

0

XEP-0156 还有另一种我最初不理解的方法,称为 HTTP 查找,从 javascript 调用,然后解析响应更实用。

如果 xmpp 服务器支持它,则将 /.well-known/host-meta 附加到服务器的 URL,如 tigase.im/.well-known/host-meta

使用 /.well-known/host-meta.json 解析会更容易

于 2022-02-10T16:54:59.330 回答
0

XEP-0156 除了指定 DNS SRV 记录以查找 websocket 端口外,还表示它们可能在 DNS TXT 记录中指定。正如我尝试的那样,可以使用带有字符串 _xmppconnect.tigase.im 的 mxtoolbox.com 或使用 linux 和 Windows 控制台命令“dig +short txt _xmppconnect.tigase.im”或“nslookup q=txt _xmppconnect.tigase”找到这些。我是”

感谢 Reddit 上的 AGodThatCanDance

于 2022-02-09T10:25:47.553 回答