powered by Jive Software

Openfire-NodeJs Plugin

As a follow-up to my original OpenfireJs plugin for Openfire, I have created a new plugin that embeds the NodeJs binary and runs it as a java Proces. It includes the binaries for Windows, Linux and OSX (64bit and 32bit) and selects which one to use. There is a long story behind my need to get JavasScript embedded in Openfire and I will blog about it some time soon.

For example, it can be used with the excellent node-xmpp library to quickly implement xmpp components or even XEPs. Each Node process is under Openfire control and can benefit from being part of the Openfire infastructure, clustering, database access, user/group maanagement.

In the meanwhile, if there are no objections, I would like to make it an official Openfire plugin to be included in the next release.

** Update **

I have attached the proof of concept plugin. Just dop it into openfire as usual. It will create a new folder under OPENFIRE_HOME called nodejs. Unzip the etherpad node application into this folder and create the following properties in openfire.

js.nodejs.etherpad.path = OPENFIRE_HOME/nodejs/etherpad

js.nodejs.etherpad = node_modules/ep_etherpad-lite/node/server.js

Point two or more browsers at http://your_openfire_server:9001/p/test

1 Like

To preempt any questions about why I have not considered nashorn and project avatar. Please see this

http://strongloop.com/strongblog/how-to-run-node-js-on-the-jvm-with-avatar-js-an d-loopback/

I actually stated work on this new plugin with nashorn and avatar, but decided to go with using nodejs directly for three reasons.

  1. Performance. Google’s V8 engine outperforms Nashorn

  2. Nashorn with Avatar only runs in Java8 64bit platforms for now

  3. Compatibility. I want to use realtime node projects like Meteor, ShareJs, TogetherJs, Etherpad, etc

Hello Dele,

Thank you for your offer to do this. I typically do not object to people volunteering to do work I am unable to comment if this is a good idea from a technical perspective. You do a great job supporting your code on the forums, so I see no reason to object to this addition.

daryl

Daryl,

Thanks for your kind words, support and inviting me to get more involved and bring my plugins onboard

hi dele I’m really facinated by this wonderful plugin

so I have a node js project I want to run it not by command prompt but when my openfire server runs so after Installing the plugin what configuration do I have to do so the openfire knows what project to run . I 'll be grateful if you post a step by step tutorial . thank you very much

1 Like

Did you have any luck? I also have a node project and would love to see a step by step tutorial to integrate it…

For anyone who stumbles on this plugin. Yes, there is no documentation. Apologies. The source code is your friend.

The nodejs plugin was to enable an existing Openfire plugin be extended with extra features available in a node application. You connect to Openfire from nodejs with the xmpp.js library as a client or external component and go from there.

The other thing it does which outside the scope of messaging is using it it for automating openfire admin tasks with JavaScript and the REST API