You are here

sipub + SVG = true!

That cryptic title means: Stream Initiation using Publish Subscribe and Scalable Vector Graphics are living well together. That didn't made you any wiser, did it? The long story then.

Several efforts have been made to add a whiteboarding protocol to XMPP based on SVG, which is the web standard for 2D graphics, but a dynamic environment like XMPP is very far from a static web situation. In particular, there are synchronization issues and a few other things. One of the other things is that image entities are referenced using a HTTP link, and that wont work well for clients which normally live behind NATs and firewalls etc.

XMPP specifies a number of file transfer protocols (si, ibb, ftrans, bytestreams) and a runner up is something based on jingle using UDP instead of TCP. The problem with all these standard file transfer protocols is that they assume that files are pushed to users, instead of being pulled (or GET) which is the situation on the web. The sipub protocol is a variant where users can "pull", or "get" a file, just as getting a HTTP link.

It turned out that it was pretty straightforward to add it to my Coccinella SVG protocol. In a whiteboard chat session, if a user opens an image the following stanza is sent:

<message to='' type='chat'>
  <x xmlns=''>
    <image x='80.0' y='80.0' 
        id='111958708' width='32' height='32'>
      <sipub xmlns='' 
        <file xmlns='' 

which is just an ordinary SVG image, but with a sipub element as a child. The HTTP link can be used for something else, or just ignored. A variant could be to use the XMPP URI "recvfile" syntax but I see no need to have another syntax when we already have the xml elements.

This is now implemented in the cvs version but must be switched on by some command line arguments. I should say that this is only made for the SVG image element, but I see no particular problem to use it also for foreignObject elements, or any other elements which reference an external entity. Also implemented is the XMPP "recvfile" URi syntax, but it is unclear how useful it is.