Code Monkey home page Code Monkey logo

xmppjs's Introduction

xmpp.js

Server-side XMPP in Javascript

xmpp.js is a library for Node.js that allows you to connect to an XMPP server as a component.

For those already familiar with the client-side Strophe.js library then there is almost nothing to learn - the API is almost exactly the same. The only difference is that this time you can run your code on the server, and handle XMPP traffic from clients on behalf of a whole domain. It's like writing an XMPP server but with the hard parts handled for you.

xmpp.js works with any XEP-0114-compliant server (that's practically all of them), so you need not worry about your code being tied in to a particular server implementation.

How it works at the XMPP level

XMPP components "bind" to a domain, usually a subdomain of the main XMPP service, such as pubsub.example.org, or conference.example.org. All incoming stanzas addressed to that domain (to='service.example.org') or to entities on that domain (to='[email protected]') will be routed to your xmpp.js-based code.

For outgoing stanzas your component is in full control. You can specify any 'from' address on your stanzas, many servers don't even enforce that the originating domain of the stanza is the component's domain, allowing you to send stanzas on behalf of any user on the server.

Getting started

Firstly, you'll need Node installed if you haven't it already, this is fairly straightforward - instructions are here. xmpp.js is confirmed to work with version 0.1.30 (2010.02.22).

Check out the source xmpp.js code, from either the Mercurial repository or Github project.

In the examples directory you will find an example component which echoes messages it receives back to the sender. If you have a local Prosody server installed then you can simply add these lines to your Prosody config to make this example work:

        Component "echo.localhost"
                component_secret = "hellohello"

Ater restarting Prosody try running:

        node examples/echo.js

Log into your Prosody with a client and send a message to [email protected] - you should receive an instant response back - congratulations!

xmppjs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

xmppjs's Issues

Error occured when running the echo.js example

Hi,

Does anyboday have a clue about the following error?

$ node echo.js
New connection status: 1

node.js:63
    throw e;
    ^
Error: EPERM, Operation not permitted
    at IOWatcher.callback (net:854:22)
    at node.js:768:9

Thanks!!

Does xmppjs support xmpp dataforms(XEP-0004: Data Forms)

Hi,

I am very much new to xmpp.js. Before i want to start working on xmpp.js I wanted to know below given two requirements.
a) BOSH support
b) Data Forms support

I found "node-xmpp-bosh" which supports BOSH connection. I was unable to find some links/modules for data forms(creatind and extracting dataforms) support by xmpp.js.

Can somebody help me in knowing this?

Quick response is very much appreciated.

Regards,
Guruprasad

xmpp.js support for BOSH connection

Hi,

In xmpp.js code i noticed that it will establish a tcp(port:5347) connection. Does xmpp.js support BOSH connection also, if i want to establish a BOSH connection to my openfire xmpp server which listens at 7070(http://localhost:7070/http-bind/)?

Please let me know as early as possible. Quick response is very much appreciated.

Regards,
Guruprasad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.