How to check if the server supports xmpp protocol?

I am looking for a way to check if the server supports xmpp protocol, i.e. an xmpp server is running in this domain.

Maybe a special DNS check or something like that?

+3
source share
3 answers

Most XMPP servers must support at least one of these DNS SRV records:

  • _xmpp-server._tcp .example.com
  • _xmpp-client._tcp .example.com

Some servers may not publish these records, but most of them will not want to talk to the outside world. For example, you can use "dig" on the command line to check the domain, for example:

% dig +short -t SRV _xmpp-server._tcp.gmail.com.
20 0 5269 xmpp-server2.l.google.com.
20 0 5269 xmpp-server3.l.google.com.
20 0 5269 xmpp-server4.l.google.com.
5 0 5269 xmpp-server.l.google.com.
20 0 5269 xmpp-server1.l.google.com.

"+ short" DNS, "-t SRV" , SRV, , .

( @user188719) SRV, 5222 5269 .

, telnet hostname port, , . , , XMPP /, XMPP. nc netcat . -:

% echo "<stream:stream to='gmail.com' version='1.0' xmlns='jabber:server' xmlns:stream='http://etherx.jabber.org/streams' xmlns:db='jabber:server:dialback'>" | nc xmpp-server.l.google.com 5269
<stream:stream id="0A44AFB86521393A" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:server" xmlns:db="jabber:server:dialback">
+6

, SRV ( ) 5269. .

+2

Source: https://habr.com/ru/post/1712023/


All Articles