Git Product home page Git Product logo

ejabberd-websockets's Introduction

Websocket Module for Ejabberd

This is a module that adds websocket support for the ejabberd XMPP server. It's a more elegant, modern and faster replacement to Bosh.

It is an implementation of the XMPP Over Websocket Draft proposed by Jack Moffitt and Eric Cstari. The Websocket implementation is based on this draft specification.

**You need to use the apt version of ejabberd, as the binary install comes with an old version of erlang. **

Install

Build

./build.sh

Install

cp ebin/*.beam /path/to/ejabberd/lib/ebin/

Configure

In the listeners section add the following line:

{5288, ejabberd_websocket, [{request_handlers, [{["ws-xmpp"], mod_websocket}]}]},

Make sure you also add this line in the Modules

{mod_websocket, []}

Usage

Just connect to the websocket using your browser's API, and send your XMPP traffic over it.

You may find it convenient to use directly Strophejs as it's a full XMPP library in Javascript. However, you will have to use this branch for now, as it adds support for websocket, as the underlying protocol (instead of Bosh).

To setup a connection : // WS_SERVICE should be http://host.tld:5288/ws-xmpp, based on the configuration you chose. connection = new Strophe.Connection({protocol: new Strophe.Websocket(WS_SERVICE) });

TODO

The most 'urgent' thing to do is to provide fallback mechanisms in this module. For example, support for socket.io would be amazing, as erlang has its own implementation. Feel free to fork and make it better!

Thank you

Sponsored by Superfeedr. Special thanks to Nathan for his awesome work, Jack for his help.

License

See License.markdown.

ejabberd-websockets's People

Contributors

julien51 avatar thepug avatar

Stargazers

 avatar

Watchers

 avatar

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.