Erlang

n2o

⭕ N2O: Distributed WebSocket Application Server ISO 20922

S

synrc

Dernière activité 4 juin 2026
synrc/n2o

1,3 k

étoiles

167

forks

1

issues ouvertes

bertmqtttcpudpwebsockets

Ce README est souvent en anglais.

N2O: TCP MQTT WebSocket

Actions Status Hex pm

N2O is an embeddable message protocol loop library for WebSocket, HTTP, MQTT and TCP servers. It provides basic features, such as process management, virtual nodes ring for request processing, sessions, frame encoding, and unified API for external mq and caching services.

Core Features

  • Purpose: High performance protocol relay
  • Endpoints: WebSockets, MQTT, TCP
  • Codebase: 700 LOC (Erlang), 500 LOC (JavaScript)
  • Dialyzer: REBAR, REBAR3, MAD, MIX
  • Hosts: BANDIT, COWBOY, EMQ, MOCHIWEB, RING, TCP, UDP
  • PubSub: GPROC, SYN, PG2
  • Formatters: JSON, BERT, ASN.1

Protocol Extensions

  • Templates: DTL, NITRO
  • Abstract Database Layer KVS: FS, MNESIA, ROCKSDB, RIAK, REDIS
  • Business Processes: BPE (BPMN 2.0), SCM, ERP, CRM
  • HTTP API: REST (proplist/JSON)
  • ACTIVE Reloading: GNU/Linux, Windows, macOS

Basic Samples

Enterprise Samples

  • Online Client Bank: BANK (8041)
  • Instant Messaging: CHAT (8042)
  • Product Lifecycle Management: PLM (8043)

Motivation

N2O was created to bring clarity and sanity to software development. The distribution model is per file basis with ISC license.

Kernel

The core modules provide OTP start and N2O entry point.

WebSocket

N2O Loop is directly connected and ran inside context of WebSocket handler. Usually in Erlang we use syn or gproc OTP message buses. As such buses are optional in MQTT setup we include bus drivers in WebSocket package.

git clone git@github.com:synrc/sample && cd sample
rebar3 shell
open http://localhost:8001/app/login.htm

Protocols

N2O ships with 3 optional protocols.

Services

Formatters, Sessions, etc. Optional.

JavaScript

Literature

  • PDF (versions 0.11—4.4)
  • HTML (versions 4.5—9.11)

Projets similaires

Simple, secure & standards compliant web server for the most demanding of applications

C++commercialcross-platformhttp
UuNetworking
19 k étoiles1,9 k

Embedded web server, with TCP/IP network stack, MQTT and Websocket

Cembeddedhttpiot
Ccesanta
13,1 k étoiles2,9 k

The most scalable and reliable MQTT broker for AI, IoT, IIoT and connected vehicles

Erlangaiotbrokercoap
Eemqx
16,8 k étoiles2,6 k