[Standards] querying for random services

Peter Saint-Andre stpeter at jabber.org
Mon May 7 21:20:49 UTC 2007

As discussed in the STUN server discovery thread, it would be nice to 
ask your XMPP server which STUN servers it knows about.

But why limit it to STUN? You might also want to ask your XMPP server 
about the pubsub services or bytestreams proxies or Teredo services 
(etc.) it knows about.

Granted you can find this out by sending a disco#items request and 
receiving a list of everything out there, but what if you only want to 
know about STUN servers and nothing else?

Based on discussions in the jdev room and offlist emails, I've been 
thinking about something like this:

<iq type='get' from='bard at shakespeare.lit/globe' to='shakespeare.lit' 
   <query xmlns='http://jabber.org/protocol/disco#items'

That is, "please send me one disco item for each STUN server you know 
about". (I'm not wedded to that node syntax, but we need something that 
enables you to specify the kinds of entities you want to match.)

Then, using XEP-0030 and XEP-0128, the server replies:

<iq type='result' from='shakespeare.lit' to='bard at shakespeare.lit/globe' 
   <query xmlns='http://jabber.org/protocol/disco#items'>
     <item jid='not-sure-what-the-jid-is!'>
       <x xmlns='jabber:x:data' type='result'>
         <field var='FORM_TYPE' type='hidden'>
         <field var='host'>
         <field var='port'>
         <field var='username'>
         <field var='password'>

The nice thing is, this gives us a generic approach so that we don't 
have one protocol for finding STUN servers, another for finding Teredo 
services, another for finding pubsub services, etc.

Note that this enables queries only based on identity -- i.e., the 
category and type specified in the following registry:


But it's easy enough to add new identities to that registry.

One aspect I'm not sure of is: what does the XMPP server return as the 
JID of a service that is not accessible via XMPP (such as a STUN 
server)? Presumably it would return the JID of the XMPP server itself.



Peter Saint-Andre
XMPP Standards Foundation

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7358 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.jabber.org/pipermail/standards/attachments/20070507/d093fec0/attachment.bin>

More information about the Standards mailing list