Convert Figma logo to code with AI

processone logoejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)

6,056
1,505
6,056
181

Top Related Projects

An XMPP server licensed under the Open Source Apache License.

11,786

Synapse: Matrix homeserver written in Python/Twisted.

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..

11,918

Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots

Self-hosted chat app for small teams

The communications platform that puts data protection first.

Quick Overview

ejabberd is a robust, scalable, and fault-tolerant XMPP server written in Erlang. It is widely used for building real-time messaging systems and has been in active development since 2002. ejabberd supports various features like multi-user chat, publish-subscribe, and server-to-server communication.

Pros

  • Highly scalable and can handle millions of concurrent users
  • Supports multiple authentication methods and databases
  • Extensive plugin system for customization and extension
  • Active community and regular updates

Cons

  • Steep learning curve, especially for those unfamiliar with Erlang
  • Configuration can be complex for advanced setups
  • Resource-intensive for small-scale deployments
  • Documentation can be inconsistent or outdated in some areas

Code Examples

  1. Creating a new user:
ejabberd_auth:try_register("username", "server.com", "password")
  1. Sending a message:
ejabberd_router:route(
    jid:make("sender", "server.com", "resource"),
    jid:make("recipient", "server.com", "resource"),
    {xmlel, "message", [{<<"type">>, <<"chat">>}], [{xmlel, "body", [], [{xmlcdata, "Hello!"}]}]}
)
  1. Creating a multi-user chat room:
mod_muc:create_room("roomname", "conference.server.com", "nickname")

Getting Started

To get started with ejabberd:

  1. Install ejabberd:

    sudo apt-get install ejabberd
    
  2. Configure ejabberd by editing /etc/ejabberd/ejabberd.yml:

    hosts:
      - "example.com"
    
    listen:
      -
        port: 5222
        module: ejabberd_c2s
        starttls: true
    
    modules:
      mod_roster: {}
      mod_muc: {}
      mod_pubsub: {}
    
  3. Start ejabberd:

    sudo systemctl start ejabberd
    
  4. Create an admin user:

    sudo ejabberdctl register admin example.com password
    

Now you can connect to your ejabberd server using an XMPP client.

Competitor Comparisons

An XMPP server licensed under the Open Source Apache License.

Pros of Openfire

  • Written in Java, making it more accessible for Java developers
  • Extensive plugin ecosystem with a wide range of additional features
  • User-friendly web-based administration interface

Cons of Openfire

  • Generally considered less scalable for very large deployments
  • May have higher resource consumption compared to ejabberd
  • Less optimized for high-concurrency scenarios

Code Comparison

Openfire (Java):

public class XMPPServer {
    private static XMPPServer instance;
    
    public static XMPPServer getInstance() {
        return instance;
    }
}

ejabberd (Erlang):

-module(ejabberd_app).
-behaviour(application).

start(_Type, _Args) ->
    ejabberd_sup:start_link().

The code snippets show the different programming languages and paradigms used in each project. Openfire uses Java's object-oriented approach with a singleton pattern, while ejabberd leverages Erlang's functional programming and OTP behaviors.

Both projects are mature, open-source XMPP servers with active communities. ejabberd is known for its high performance and scalability, especially in large deployments, while Openfire offers a more user-friendly experience and easier customization through its plugin system. The choice between them often depends on specific project requirements, team expertise, and scalability needs.

11,786

Synapse: Matrix homeserver written in Python/Twisted.

Pros of Synapse

  • Built on modern, decentralized Matrix protocol, offering better interoperability
  • Supports end-to-end encryption by default, enhancing privacy and security
  • More flexible architecture, allowing for easier integration with other services

Cons of Synapse

  • Generally requires more system resources than ejabberd
  • Can be more complex to set up and configure for beginners
  • Smaller ecosystem of plugins and extensions compared to ejabberd

Code Comparison

Synapse (Python):

class FederationServlet(servlet.ServletBase):
    def __init__(self, hs):
        servlet.ServletBase.__init__(self)
        self.homeserver = hs

ejabberd (Erlang):

-module(ejabberd_c2s).
-behaviour(gen_fsm).

start(SockData, Opts) ->
    gen_fsm:start_link(?MODULE, [SockData, Opts], fsm_limit_opts(Opts)).

The code snippets show different programming languages and paradigms. Synapse uses Python with an object-oriented approach, while ejabberd uses Erlang with a functional programming style. This difference affects development, performance, and scalability characteristics of each project.

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..

Pros of Mattermost

  • More modern, feature-rich team collaboration platform
  • Active development with frequent updates and new features
  • Extensive integrations and plugins ecosystem

Cons of Mattermost

  • Higher resource requirements for hosting
  • Steeper learning curve for administrators
  • Less flexible for custom XMPP implementations

Code Comparison

Ejabberd (Erlang):

handle_message(From, To, Packet) ->
    case ejabberd_hooks:run_fold(pre_message_hook,
                                 To#jid.lserver,
                                 {From, To, Packet},
                                 []) of
        drop -> ok;
        {From, To, Packet} ->
            ejabberd_router:route(From, To, Packet)
    end.

Mattermost (Go):

func (a *App) SendEphemeralPost(userID string, post *model.Post) *model.Post {
    post.Type = model.POST_EPHEMERAL

    // Make sure the post is valid
    if err := a.Srv().Store.Post().Save(post); err != nil {
        mlog.Error("Failed to save ephemeral post", mlog.Err(err))
        return nil
    }

    a.Publish(model.NewWebSocketEvent(
        model.WEBSOCKET_EVENT_EPHEMERAL_MESSAGE,
        "", post.ChannelId, userID, nil,
    ).Add("post", post.ToJson()))

    return post
}

Both projects use different programming languages and architectures, reflecting their distinct approaches to messaging and collaboration.

11,918

Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots

Pros of Tinode

  • Modern, mobile-first architecture designed for real-time messaging
  • Built-in support for end-to-end encryption
  • Easier to set up and deploy for small to medium-scale applications

Cons of Tinode

  • Less mature and battle-tested compared to ejabberd
  • Smaller community and ecosystem
  • Limited support for legacy XMPP protocols

Code Comparison

Tinode (Go):

func (t *Topic) runLocal(msg *ServerComMessage) {
    if msg.Data != nil {
        t.saveAndDistributeMessage(msg)
    } else if msg.Pres != nil {
        t.handlePresence(msg)
    }
}

ejabberd (Erlang):

process_iq(From, To, IQ) ->
    case catch do_route(From, To, IQ) of
        {'EXIT', Reason} ->
            ?ERROR_MSG("Error processing IQ:~n~p", [Reason]),
            ejabberd_router:route_error_reply(To, From, IQ, ?ERR_INTERNAL_SERVER_ERROR);
        _ ->
            ok
    end.

Both projects implement messaging functionality, but Tinode uses Go for a more modern, concurrent approach, while ejabberd relies on Erlang's robust distributed systems capabilities. Tinode's code focuses on real-time message handling, while ejabberd's example shows IQ (Info/Query) packet processing, reflecting its XMPP roots.

Self-hosted chat app for small teams

Pros of lets-chat

  • Simpler setup and deployment, ideal for small to medium-sized teams
  • Built-in web interface for easy access and management
  • Focused on team collaboration with features like file sharing and message history

Cons of lets-chat

  • Less scalable for large-scale deployments compared to ejabberd
  • Limited protocol support, primarily focused on web-based chat
  • Fewer advanced features and customization options

Code Comparison

ejabberd (Erlang):

start() ->
    application:start(ejabberd).

stop() ->
    application:stop(ejabberd).

lets-chat (JavaScript):

var app = require('./app');
var http = require('http');

var server = http.createServer(app);
server.listen(app.get('port'), function() {
    console.log('Let\'s Chat is running on port ' + app.get('port'));
});

The code snippets demonstrate the different languages and approaches used by each project. ejabberd uses Erlang and focuses on application start/stop functions, while lets-chat uses JavaScript with Node.js, showing a more web-centric setup.

ejabberd is a robust, scalable XMPP server with extensive features and protocol support, suitable for large-scale deployments. lets-chat, on the other hand, is a more lightweight, web-focused chat solution that's easier to set up and use for smaller teams, but with fewer advanced features and less scalability.

The communications platform that puts data protection first.

Pros of Rocket.Chat

  • More comprehensive collaboration features, including video conferencing and screen sharing
  • User-friendly interface with a modern, customizable design
  • Extensive marketplace for integrations and add-ons

Cons of Rocket.Chat

  • Higher resource requirements for hosting and deployment
  • Steeper learning curve for administrators due to more complex features
  • Less optimized for high-scale, lightweight messaging compared to ejabberd

Code Comparison

Rocket.Chat (JavaScript):

Meteor.publish('userData', function() {
  if (!this.userId) {
    return this.ready();
  }
  return Users.find(this.userId, {
    fields: {
      name: 1,
      username: 1,
      status: 1,
      statusDefault: 1,
      statusText: 1,
      emails: 1,
      settings: 1,
      language: 1,
      utcOffset: 1,
      active: 1,
      roles: 1,
      avatarETag: 1,
    },
  });
});

ejabberd (Erlang):

-spec process_iq(iq()) -> iq().
process_iq(#iq{type = set, sub_el = SubEl} = IQ) ->
    case xml:get_subtag(SubEl, <<"query">>) of
        false ->
            IQ#iq{type = error, sub_el = [SubEl, err_bad_request()]};
        Query ->
            process_query(IQ, Query)
    end;
process_iq(#iq{type = get} = IQ) ->
    IQ#iq{type = error, sub_el = [SubEl, err_not_allowed()]}.

This comparison highlights the different programming languages and approaches used by each project, with Rocket.Chat utilizing JavaScript and Meteor framework, while ejabberd is built with Erlang.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README


ejabberd is an open-source, robust, scalable and extensible realtime platform built using Erlang/OTP, that includes XMPP Server, MQTT Broker and SIP Service.

Check the features in ejabberd.im, ejabberd Docs, ejabberd at ProcessOne, and the list of supported protocols in ProcessOne and XMPP.org.

Installation

There are several ways to install ejabberd:

Documentation

Please check the ejabberd Docs website.

When compiling from source code, you can get some help with:

./configure --help
make help

Once ejabberd is installed, try:

ejabberdctl help
man ejabberd.yml

Development

Bug reports and features are tracked using GitHub Issues, please check CONTRIBUTING for details.

Translations can be improved online using Weblate or in your local machine as explained in Localization.

Documentation for developers is available in ejabberd docs: Developers.

There are nightly builds of ejabberd, both for master branch and for Pull Requests:

Security reports or concerns should preferably be reported privately, please send an email to the address: contact at process-one dot net or some other method from ProcessOne Contact.

For commercial offering and support, including ejabberd Business Edition and Fluux (ejabberd in the Cloud), please check ProcessOne ejabberd page.

Community

There are several places to get in touch with other ejabberd developers and administrators:

License

ejabberd is released under the GNU General Public License v2 (see COPYING), and ejabberd translations under MIT License.