S: <stream:features>
S: <multiplex xmlns='ns:multiplex'/>
S: </stream:features>
C: <enable xmlns='ns:multiplex'/>
S: <enabled xmlns='ns:multiplex'/>
From this point forward, all data exchanged with the server must use this
format:
[1-byte channel] [2-byte value length in network byte order] [value bytes]
For example:
00 00 0B 3C 70 72 65 73 65 6E 63 65 2F 3E
Would mean:
channel: 0
value: <presence/>
Channel 0 is the XML stream, and operates no differently. Channel 1 and
higher may be used for some other purpose. Additionally, since the value
sizes are known by the recipient, channel usages can make use of this
knowledge.
IBB using stream multiplexing
----
Send <data> with no child cdata, and include a 'channel' attribute with an
integer channel number value. The actual IBB payload data will be present
in unencoded form on the specified channel.
How to send "Hello world" in an IBB packet:
C1: Hello world
C0: <iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'
C0: type='set' id='ibb1'>
C0: <data xmlns='http://jabber.org/protocol/ibb' sid='mySID' seq='0'
C0: channel='1'/>
C0: </iq>