The n2o_nitro module provides Nitrogen Web Framework protocol specification and implementation.


Init message invokes event(init) function in page module. There are two binary representations of INIT message. The first one is BERT encoded #init record with binary token that usually issued by n2o_session, transported in #io record as data parameter and stored on client side in localStorage or Key Chain. Clients with invalid tokens are being registered and reissued.

-record(init, { token :: binary() }).

The second one is TEXT encoded version of message, <<"N2O,">> that usually works for hosts with raw binary falicities as WebSockets.


For token issue protocol see n2o_session module.


Pickle message sends to server prerendered (by server) encripted message. These messages hold #ev record with callee information (encripted). Pickled messaged can prolongate expiration field in session token (renewed) by updating client token on each UI request (tracking user activity) when n2o application variable nitro_prolongate equals true.

-record(pickle, { source = [] :: [] | binary(), pickled = [] :: [] | binary(), args = [] :: list({atom(),any()}) }). -record(ev, { module = [] :: [] | atom(), msg = [] :: any(), trigger = [] :: [] | binary(), name = [] :: [] | binary() }).


Direct message sends data without any convertation or encription or session logic.

-record(direct, { data = [] :: any() }).


Flush message only redirects data to the socket.

-record(flush, { data = [] :: [] | list(#action{}) }).

You may also want to read: n2o_heart, n2o_ftp.