Flash XMLSocket

oliver oli oliver.oli at gmail.com
Fri Dec 1 12:11:57 UTC 2006


Martin Atkins wrote:
>> What's the quick summary of this protocol, for those of us that don't 
>> know
>> Flash?  Any pointers?
>>
> 
> According to the page at this huge URL:
> <http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary860.html> 
> 
> 
> it's a TCP connection where you send whole XML documents delimited by nuls.

XMLSocket is not limited to XML documents. You can send any data over 
it. Every XMLSocket.send appends a NUL byte to the data. I don't know if 
NUL bytes in XML streams are any problem for DJabberd (or other Jabber 
servers).

What's more important: Flash expects NUL bytes in the data it receives. 
When it receives a NUL byte on the XML socket, the callback function 
XMLSocket.onData or XMLSocket.onXML is invoked. Which means the Jabber 
server have to append a NUL to the XML packets it sends.

> Even without DJabberd support it probably wouldn't be too hard to write 
> a little proxy in the language of your choice which would have Flash 
> XMLSocket on one end and an XMPP stream on the other.
> 
> Could specify that the first "packet" contains the stream element (with 
> appropriate namespace declarations) and the c2s handshake (or whatever) 
> and subsequent packets contain bare stanzas. The advantage of subsequent 
> packets using bare stanzas is that you don't have to worry too much 
> about the client introducing crazy new namespaces when the <stream> 
> element has been and gone: you can just massage the prefixes and pass 
> everything over otherwise verbatim.
> 
> Probably wouldn't be too hard to make a DJabberd connection plugin that 
> could do this, but a proxy such as this would be useful for users of 
> other Jabber servers too.

A Flash-Jabber proxy would be nice to have, but I don't know any. Would 
DJabberd with a Flash connection plugin make a XMPP proxy for other 
Jabber servers or is this a silly idea?



More information about the Djabberd mailing list