123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <meta name="description" content="" />
- <meta name="author" content="Maxim Sokhatsky" />
- <title>NITRO</title>
- <link rel="stylesheet" href="https://n2o.dev/blank.css?x=15" />
- <link rel="stylesheet" href="https://n2o.dev/zima.css?x=15" />
- <link rel="shortcut icon" type="image/x-icon" href="../img/favicon.ico" />
- <link rel="apple-touch-icon" sizes="180x180" href="../img/apple-touch-icon.png" />
- <link rel="icon" type="image/png" sizes="32x32" href="../img/favicon-32x32.png" />
- <link rel="icon" type="image/png" sizes="16x16" href="../img/favicon-16x16.png" />
- <link rel="manifest" href="../img/site.webmanifest" />
- </head>
- <body>
- <nav>
- <a href="https://n2o.dev">DEV</a>
- <a href="https://ws.n2o.dev">N2O</a>
- <a href="#" style="background:#ededed;">NITRO</a>
- <div class="dropdown">
- <a onclick="drop()" class="dropbtn">EN</a>
- <div id="dropdown" class="dropdown-content">
- <a href="https://n2o.dev/deps/n2o/man/ua/n2o_nitro.htm">UA</a>
- <a href="n2o_nitro.htm">EN</a>
- </div>
- </div>
- </nav>
- <header>
- <a href="../index.html"><img src="https://openmoji.org/data/color/svg/1F525.svg" /></a>
- <h1>NITRO</h1>
- </header>
- <main>
- <article>
- <section>
- <h3>INTRO</h3>
- <p>The <a href="https://github.com/synrc/nitro/blob/master/src/nitro_n2o.erl">nitro_n2o</a> module provides
- <a href="http://nitrogenproject.com/demos">Nitrogen Web Framework</a>
- protocol specification and implementation.</p>
- </section>
- <section>
- <h3>INIT</h3>
- <p>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.</p>
- <figure>
- <code>
- -record(init, { token :: binary() }).
- </code>
- </figure>
- <p>The second one is TEXT encoded version of message, <<"N2O,">>
- that usually works for hosts with raw binary falicities as WebSockets.
- </p>
- <figure>
- <code>
- <<"N2O,",Token/binary>>
- </code>
- </figure>
- <p>For token issue protocol see <a href="n2o_session.htm">n2o_session</a> module.</p>
- </section>
- <section>
- <h3>PICKLE</h3>
- <p>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 <b>nitro_prolongate</b> equals <b>true</b>.</p>
- <div>
- <figure>
- <code>
- -record(pickle, { source = [] :: [] | binary(),
- pickled = [] :: [] | binary(),
- args = [] :: list({atom(),any()}) }).
- -record(ev, { module = [] :: [] | atom(),
- msg = [] :: any(),
- trigger = [] :: [] | binary(),
- name = [] :: [] | binary() }).
- </code>
- </figure>
- </div>
- </section>
- <section>
- <h3>DIRECT</h3>
- <p>Direct message sends data without any convertation or encription or session logic.</p>
- <div>
- <figure>
- <code>
- -record(direct, { data = [] :: any() }).
- </code>
- </figure>
- </div>
- </section>
- <section>
- <h3>FLUSH</h3>
- <p>Flush message only redirects data to the socket.</p>
- <div>
- <figure>
- <code>
- -record(flush, { data = [] :: [] | list(#action{}) }).
- </code>
- </figure>
- </div>
- </section>
- <section>
- <p>You may also want to read:
- <b><a href="n2o_heart.htm">n2o_heart</a></b>,
- <a href="n2o_ftp.htm">n2o_ftp</a>.
- </p>
- </section>
- </article>
- </main>
- <footer>2005—2019 © Synrc Research Center</footer>
- <script>function drop(){document.getElementById("dropdown").classList.toggle("show");}</script>
- </body>
- </html>
|