XMPP: code for parsing SOCKS5 bytestreams query answer

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Net::XMPP::Namespaces
# code for parsing http://xmpp.org/extensions/xep-0065.html#example-11 (SOCKS5 bytestreams query answer)
$con->AddNamespace(
ns=>'http://jabber.org/protocol/bytestreams',
tag=>'query',
xpath=>{
SID => { path => '@sid' },
Mode => { path => '@mode' },
Streamhost => {
type => 'child',
path => 'streamhost',
child => { ns => '__netjabber__:jabber:streamhost' },
calls => [ 'Get', 'Defined' ],
},
Bytestream => { type => 'master' }
}
);
$con->AddNamespace(
ns=>'__netjabber__:jabber:streamhost',
xpath=>{
JID => { path => '@tid' },
Host => { path => '@host' },
Port => { path => '@port' },
Zeroconf => { path => '@zeroconf' },
Streamhost => { type => 'master' }
}
);