Can a PacketInterceptor Plugin accept arbitrary xml?

i’m looking to write a plugin that listens for particular xml data sent in (not an XMPP packet, arbitrary xml) and then replies with a certain xml response. (also not XMPP)

looking for ideas for the best way to do this. the PacketInterceptor interface seems to give me a chance to read all incoming packets, but since the incoming xml is not an XMPP packet, i imagine it wouldn’t get that far.

or should i go lower and look to listen directly on the open socket connections. if so, what’s the easiest way to do this?

thanks.

Hey kthorn,

In XMPP, clients are only allowed to send to the server certain type of XML stanzas. If your client tries to send an unknown type of XML stanza then it will be disconnected. However, the X of XMPP means that it’s about extensibility. That means that XMPP allows you to attached “arbitrary” XML elements to valid XML stanzas (i.e. IQ, Presence and Message). You can use an IQ packet type if your client wants to send something and expect a reply from the server or any other client. Presence and Messages do not necessarily imply that there is going to be a reply. All of them can be extended to include your custom XML content. For more information you may want to look at the XMPP spec.

Regards,

– Gato

unfortunately, i’ve found that the packetinterceptor does not start retrieving packets until after the handshake occurs for a connection, therefore i could not use it for my purposes

Hey kthorn,

You are right. As you can see in the XMPP spec clients need to perform some initial steps to be able to start using the server. IMO, you either go with the flow or do not use an XMPP server. That means that your clients have to have XMPP support to be able to speak with an XMPP server. They cannot just open a socket and send custom XML packets.

Regards,

– Gato