|
@@ -1,105 +1,121 @@
|
|
-<!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?v=2" /></head><body><nav>
|
|
|
|
- <a href="https://n2o.dev/ua/">DEV</a>
|
|
|
|
- <a href="index.html">NITRO</a>
|
|
|
|
- <a href="#" style="background:#ededed;">N2O</a>
|
|
|
|
|
|
+<!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">
|
|
<div class="dropdown">
|
|
- <a onclick="drop()" class="dropbtn">UA</a>
|
|
|
|
|
|
+ <a onclick="drop()" class="dropbtn">EN</a>
|
|
<div id="dropdown" class="dropdown-content">
|
|
<div id="dropdown" class="dropdown-content">
|
|
<a href="https://n2o.dev/deps/n2o/man/ua/n2o_nitro.htm">UA</a>
|
|
<a href="https://n2o.dev/deps/n2o/man/ua/n2o_nitro.htm">UA</a>
|
|
- <a href="https://n2o.dev/deps/n2o/man/de/n2o_nitro.htm">DE</a>
|
|
|
|
- <a href="https://ws.n2o.space/man/n2o_nitro.htm">EN</a>
|
|
|
|
|
|
+ <a href="n2o_nitro.htm">EN</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-</nav><header>
|
|
|
|
- <a href="../index.html"><img src="https://openmoji.org/data/color/svg/1F525.svg" /></a>
|
|
|
|
- <h1>N2O</h1>
|
|
|
|
|
|
+</nav>
|
|
|
|
+<header>
|
|
|
|
+ <a href="../index.html"><img src="https://openmoji.org/data/color/svg/1F525.svg" /></a>
|
|
|
|
+ <h1>NITRO</h1>
|
|
</header>
|
|
</header>
|
|
<main>
|
|
<main>
|
|
<article>
|
|
<article>
|
|
- <section>
|
|
|
|
- <h3>ВСТУП</h3>
|
|
|
|
|
|
+ <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()}) }).
|
|
|
|
|
|
- <p>Модуль <a href="https://github.com/synrc/nitro/blob/master/src/nitro_n2o.erl">nitro_n2o</a>
|
|
|
|
- містить реалізацію протоколу <a href="http://nitrogenproject.com/demos">Nitrogen Web Framework</a>
|
|
|
|
- у відповідності до вимог специфікації N2O.</p>
|
|
|
|
-
|
|
|
|
- </section>
|
|
|
|
- <section>
|
|
|
|
- <h3>INIT</h3>
|
|
|
|
- <p>Повідомлення init викликає функцію event(init) модуля сторінки.
|
|
|
|
- Існує два способи передати бінарне повідомлення INIT.
|
|
|
|
- Перший спосіб — закодований в BERT #init record з бінарним токеном,
|
|
|
|
- який, зазвичай, створюється n2o_session, передається в #io record
|
|
|
|
- як параметр даних та зберігається на клієнті в localStorage чи Key Chain.
|
|
|
|
- Клієнти з недійсними токенами реєструються та отримують нові токени.</p>
|
|
|
|
- <figure><code>
|
|
|
|
- -record(init, { token :: binary() }).
|
|
|
|
- </code></figure>
|
|
|
|
- <p>Другий спосіб — бінарна текстова версія повідомлення, <<"N2O,">>
|
|
|
|
- що, зазвичай, працює для хостів зі здатністю до неформатованої бінарної
|
|
|
|
- передачі, таких, як протокол WebSockets.
|
|
|
|
- </p>
|
|
|
|
- <figure><code>
|
|
|
|
- <<"N2O,",Token/binary>>
|
|
|
|
- </code></figure>
|
|
|
|
- <p>Щоб детальніше дізнатись про протокол видачі токенів дивіться
|
|
|
|
- модуль <a href="n2o_session.htm">n2o_session</a>.</p>
|
|
|
|
- </section>
|
|
|
|
- <section>
|
|
|
|
- <h3>PICKLE</h3>
|
|
|
|
- <p>Повідомлення pickle надсилає на сервер заздалегідь підготовлене (за
|
|
|
|
- допомогою сервера) зашифроване повідомлення.
|
|
|
|
- Такі повідомлення містять #ev record з інформацією викликача (зашифровані).
|
|
|
|
- Зашифровані повідомлення можуть подовжувати термін придатності токена сесії
|
|
|
|
- за допомогою оновлення токена клієнта при кожному UI
|
|
|
|
- запиті (відстеження активності користувачів), для включення цього режиму
|
|
|
|
- змінна середовища <b>nitro_prolongate</b> додатку n2o повинна бути <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 надсилає дані без задіяння механізмів діалогу,
|
|
|
|
- сесії чи шифрування. Терм у полі data безпосередньо попадає в event
|
|
|
|
- функцію модуля-контроллеру сторінки.</p>
|
|
|
|
- <div>
|
|
|
|
- <figure><code>
|
|
|
|
- -record(direct, { data = [] :: any() }).
|
|
|
|
- </code></figure>
|
|
|
|
- </div>
|
|
|
|
- </section>
|
|
|
|
- <section>
|
|
|
|
- <h3>FLUSH</h3>
|
|
|
|
- <p>Повідомлення flush лише перенаправляє дані в сокет.</p>
|
|
|
|
- <div>
|
|
|
|
- <figure><code>
|
|
|
|
- -record(flush, { data = [] :: [] | list(#action{}) }).
|
|
|
|
- </code></figure>
|
|
|
|
- </div>
|
|
|
|
- </section>
|
|
|
|
- <section>
|
|
|
|
-
|
|
|
|
-<p>Можливо, Ви також бажаєте почитати про:
|
|
|
|
-<b>
|
|
|
|
-<a href="n2o_heart.htm">n2o_heart</a>,
|
|
|
|
-<a href="n2o_ftp.htm">n2o_ftp</a>
|
|
|
|
-</b>.
|
|
|
|
-</p>
|
|
|
|
-
|
|
|
|
- </section>
|
|
|
|
|
|
+ -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>
|
|
</article>
|
|
-</main><footer>
|
|
|
|
- 2005—2019 © Synrc Research Center
|
|
|
|
-</footer>
|
|
|
|
|
|
+</main>
|
|
|
|
+<footer>2005—2019 © Synrc Research Center</footer>
|
|
<script>function drop(){document.getElementById("dropdown").classList.toggle("show");}</script>
|
|
<script>function drop(){document.getElementById("dropdown").classList.toggle("show");}</script>
|
|
-</body></html>
|
|
|
|
|
|
+</body>
|
|
|
|
+</html>
|