I am looking for a couple of days now on how to deliver an incoming packet on my openfire server to another destination (i.e. different port and ip) as well
I tried Debugging and following the packet from the moment it was read from the socket until it was deliverd to its destination
and for some reason I can’t find the exact piece of code where the packet is being distributed.
For that purpose I downloded the mina apache server and attached its code to my openfire code
I tried everything and I can’t seem to find a way to it
All I need is to duplicate each packet the is received by my server and send it to another port on another ip as well
so it will be send to different destinations, one is the target users that the message is suppose to go to and another destination of my choice
Any help would be appreciated, if anyone can direct me to that piece of code I’m looking it would be great
If you’re looking to re–route a packet you could write a plugin that implements the PacketInterceptor interface. Once that packet has been intercepted you could open up a socket connection and send the contents of the packet to a client. For code samples you could look at the Openfire source to the Content Filter, Packet Filter or Subscription plugins.
I don’t want to discourage you but if you’re not familiar with Java (or any other type of software) development trying to jump right into writing a plugin is going to be challenging. That’s not to imply that writing plugins is all that difficult but most people find it easier to crawl before they try to walk. Having said that, below are two links that you can look at that should help you get up and running:
First of all thanks a lot for your help … I have been following you posts around the community in the last couple of days and they were very helpful.
I am new to OpenFire eclpise and Java … I come from the .Net world so I do have my experience
writing a plugin is a great Idea! … I will do so … my problem is setting up the environment to write it and if I should use the mina framework for the socket binding or just use the common library … I don’t want to reduce the speed and efficiency of openfire.
I saw some posts from you on how to setup the environment but they were not about eclipse … if you could direct me I would much appreciate it!
And another small question … can I just take the packet filter plugin that came with the source code and change what I need ?? if yes how do I build it afterwards
Are you wanting to send an xmpp packet to a client that is already connected to Openfire or are you trying to send the data over just a standard Java socket?