[Standards] querying for random services
Peter Saint-Andre
stpeter at jabber.org
Tue May 8 10:56:54 CDT 2007
Could you please reply inline? Top posting is confusing. :)
Unnikrishnan V wrote:
> yep , this looks good way: may be adding protocol also as field may make
> better.
Sure, we can discuss what needed to go in the extended information form.
But we would probably define one form for each protocol and that would
be the "http://www.xmpp.org/extensions/xep-xxxx.html#ns" string (it's
just a placeholder in my examples so far).
> another is standardisation of fields . The fields need to be designed
> for accomadating multiple servers.
>
> example is like var='host should be more like field var='host1'' so that
> can specify multiple servers use field var='host2"' .
I think the server would return multiple items (one for each service
that matches the query):
<iq type='result' from='shakespeare.lit' to='bard at shakespeare.lit/globe'
id='gotstun'>
<query xmlns='http://jabber.org/protocol/disco#items'>
<item jid='stun.shakespeare.lit'> <=== see below
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>http://www.xmpp.org/extensions/xep-xxxx.html#ns</value>
</field>
<field var='host'>
<value>stun.shakespeare.lit</value>
</field>
<field var='port'>
<value>9999</value>
</field>
<field var='username'>
<value>someusername</value>
</field>
<field var='password'>
<value>somepassword</value>
</field>
</x>
</item>
<item jid='192.0.2.1'> <=== see below
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>http://www.xmpp.org/extensions/xep-xxxx.html#ns</value>
</field>
<field var='host'>
<value>192.0.2.1</value>
</field>
<field var='port'>
<value>10001</value>
</field>
<field var='username'>
<value>someusername</value>
</field>
<field var='password'>
<value>somepassword</value>
</field>
</x>
</item>
</query>
</iq>
> the second q: JID of a service that is not accessible via XMPP
> should be as per http://www.xmpp.org/extensions/xep-0030.html#errors
> most probaly <service-unavailable/>
I meant: what is the value of the 'jid' attribute? We have several options:
<item jid='stun.shakespeare.lit'>
<item jid='192.0.2.1'>
.... etc. ....
(i.e., the address of the STUN server, in this case, even though the
STUN server may not have a JID)
or:
<item jid='shakespeare.lit'>
<item jid='shakespeare.lit'>
.... etc. ....
(i.e., the JID of the XMPP server in all cases)
I think the first approach is better, though perhaps it's misleading
because the STUN server may not be accessible via XMPP.
> On 5/7/07, *Peter Saint-Andre* <stpeter at jabber.org
> <mailto:stpeter at jabber.org>> wrote:
>
> 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'
> id='gotstun'>
> <query xmlns='http://jabber.org/protocol/disco#items
> <http://jabber.org/protocol/disco#items>'
>
> node='http://jabber.org/protocol/disco#info?category=server;type=stun'/
> <http://jabber.org/protocol/disco#info?category=server;type=stun'/>>
> </iq>
>
> 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'
> id='gotstun'>
> <query xmlns='http://jabber.org/protocol/disco#items'
> <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'>
> <value>
> http://www.xmpp.org/extensions/xep-xxxx.html#ns</value>
> </field>
> <field var='host'>
> <value>stun.shakespeare.lit </value>
> </field>
> <field var='port'>
> <value>9999</value>
> </field>
> <field var='username'>
> <value>someusername</value>
> </field>
> <field var='password'>
> <value>somepassword</value>
> </field>
> </x>
> </item>
> </query>
> </iq>
>
> 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:
>
> http://www.xmpp.org/registrar/disco-categories.html
>
> 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.
>
> Thoughts?
>
> Peter
>
> --
> Peter Saint-Andre
> XMPP Standards Foundation
> http://www.xmpp.org/xsf/people/stpeter.shtml
>
-------------- 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/20070508/e486a361/smime.bin
More information about the Standards
mailing list