mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Gramarly
This commit is contained in:
@@ -1866,7 +1866,7 @@
|
||||
<li><a href="jwt_auth.html">JWTs with Challenge</a></li>
|
||||
</ul>
|
||||
<p>Authentication deals with allowing a NATS client to connect to the server.
|
||||
With the exception of JWT authentication, authentication and authorization is configured in the <code>authorization</code> section of the configuration.</p>
|
||||
Except for JWT authentication, authentication and authorization are configured in the <code>authorization</code> section of the configuration.</p>
|
||||
<h2 id="authorization-map">Authorization Map</h2>
|
||||
<p>The <code>authorization</code> block provides <em>authentication</em> configuration as well as <em>authorization</em>:</p>
|
||||
<table>
|
||||
@@ -1971,7 +1971,7 @@ With the exception of JWT authentication, authentication and authorization is co
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Authentication","level":"2.5.1.2","depth":3,"next":{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},"previous":{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/auth_intro.md","mtime":"2019-05-20T19:24:10.413Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Authentication","level":"2.5.1.2","depth":3,"next":{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},"previous":{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/auth_intro.md","mtime":"2019-05-20T22:18:46.041Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1860,7 +1860,7 @@
|
||||
<p>Much like the <a href="tls.html#tls-timeout"><code>tls timeout</code> option</a>, authentication can specify a <code>timeout</code> value.</p>
|
||||
<p>If a client doesn't authenticate to the server within the specified time, the server disconnects the server to prevent abuses.</p>
|
||||
<p>Timeouts are specified in seconds (and can be fractional).</p>
|
||||
<p>As with TLS timeouts, long timeouts can be an opportunity for abuse. If setting the authentication timeout, it is important to note. that it should be longer than the <code>tls timeout</code> option, as the authentication timeout includes the TLS upgrade time.</p>
|
||||
<p>As with TLS timeouts, long timeouts can be an opportunity for abuse. If setting the authentication timeout, it is important to note that it should be longer than the <code>tls timeout</code> option, as the authentication timeout includes the TLS upgrade time.</p>
|
||||
<pre class="language-"><code>authorization: {
|
||||
timeout: 3
|
||||
users: [
|
||||
@@ -1911,7 +1911,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"next":{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]},"previous":{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/auth_timeout.md","mtime":"2019-05-16T22:49:30.181Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"next":{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]},"previous":{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/auth_timeout.md","mtime":"2019-05-20T22:19:48.082Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,8 +1857,8 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h2 id="authorization">Authorization</h2>
|
||||
<p>The NATS server supports authorization using subject-level permissions on a per-user basis. Permission-based authorization is available withmulti-user authentication via the <code>users</code> list.</p>
|
||||
<p>Each permission specifies the subjects the user can publish to and subscribe to. The parser is generous at understanding what the intent is, so both arrays and singletons are processed. For more complex configuation you can specify a <code>permission</code> object which explicetly allows or denies subjects. The specified subjects can specify wildcards. Permissions can make use of <a href="configuration.html#variables">variables</a>.</p>
|
||||
<p>The NATS server supports authorization using subject-level permissions on a per-user basis. Permission-based authorization is available with multi-user authentication via the <code>users</code> list.</p>
|
||||
<p>Each permission specifies the subjects the user can publish to and subscribe to. The parser is generous at understanding what the intent is, so both arrays and singletons are processed. For more complex configuration, you can specify a <code>permission</code> object which explicitly allows or denies subjects. The specified subjects can specify wildcards. Permissions can make use of <a href="configuration.html#variables">variables</a>.</p>
|
||||
<p>You configure authorization by creating a <code>permissions</code> entry in the <code>authorization</code> object.</p>
|
||||
<h3 id="permissions-configuration-map">Permissions Configuration Map</h3>
|
||||
<p>The <code>permissions</code> map specify subjects that can be subscribed to or published by the specified client.</p>
|
||||
@@ -1881,7 +1881,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="permission-map">Permission Map</h3>
|
||||
<p>The <code>permission</code> map provides additional properties for configuring a <code>permissions</code> map. Instead of providing a list of subjects that are allowed, the <code>permission</code> map allows you to explicitely list subjects you want to<code>allow</code> or <code>deny</code>:</p>
|
||||
<p>The <code>permission</code> map provides additional properties for configuring a <code>permissions</code> map. Instead of providing a list of subjects that are allowed, the <code>permission</code> map allows you to explicitly list subjects you want to<code>allow</code> or <code>deny</code>:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -1900,7 +1900,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Important Note</strong> NATS Authorizations are whitelist only, meaning in order to not break request/reply patterns you need to add rules as above with Alice and Bob for the <code>_INBOX.></code> pattern. If an unauthorized client publishes or attempts to subscribe to a subject that has not been whitelisted, the action fails and is logged at the server, and an error message is returned to the client.</p>
|
||||
<p><strong>Important Note</strong> NATS Authorizations are whitelist only, meaning to not break request/reply patterns you need to add rules as above with Alice and Bob for the <code>_INBOX.></code> pattern. If an unauthorized client publishes or attempts to subscribe to a subject that has not been whitelisted, the action fails and is logged at the server, and an error message is returned to the client.</p>
|
||||
<h3 id="example">Example</h3>
|
||||
<p>Here is an example authorization configuration that uses <em>variables</em> which defines four users, three of whom are assigned explicit permissions.</p>
|
||||
<pre class="language-"><code class="lang-ascii">authorization {
|
||||
@@ -1936,13 +1936,13 @@
|
||||
</li>
|
||||
<li><p><em>client</em> is a <code>REQUESTOR</code> and can publish requests on subjects <code>req.a</code> or <code>req.b</code>, and subscribe to anything that is a response (<code>_INBOX.></code>).</p>
|
||||
</li>
|
||||
<li><p><em>service</em> is a <code>RESPONDER</code> to <code>req.a</code> and <code>req.b</code> requests, so it needs to be able to subscribe to the request subjects and respond to client's that are able to publish requests to <code>req.a</code> and <code>req.b</code>. The reply subject subject is an inbox. Typically inboxes start with the prefix <code>_INBOX.</code> followed by a generated string. The <code>_INBOX.></code> subject matches all subjects that start with <code>_INBOX.</code>.</p>
|
||||
<li><p><em>service</em> is a <code>RESPONDER</code> to <code>req.a</code> and <code>req.b</code> requests, so it needs to be able to subscribe to the request subjects and respond to client's that can publish requests to <code>req.a</code> and <code>req.b</code>. The reply subject is an inbox. Typically inboxes start with the prefix <code>_INBOX.</code> followed by a generated string. The <code>_INBOX.></code> subject matches all subjects that begin with <code>_INBOX.</code>.</p>
|
||||
</li>
|
||||
<li><p><em>other</em> has no permissions granted and therefore inherits the default permission set. You set the inherited default permissions by assigning them to the <code>default_permissions</code> entry inside of the authorization configuration block.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>Note that in the above example, any client with permissions to subscribe to <code>_INBOX.></code> is able to receive <em>all</em> responses published. More sensitive installations will want to add or subset the prefix to further limit what a client can subscribe to. Alternatively <a href="jwt_auth.html"><em>Accounts</em></a> allow complete isolation limiting what members of an account can see.</p>
|
||||
<p>Note that in the above example, any client with permissions to subscribe to <code>_INBOX.></code> can receive <em>all</em> responses published. More sensitive installations will want to add or subset the prefix to further limit subjects that a client can subscribe. Alternatively, <a href="jwt_auth.html"><em>Accounts</em></a> allow complete isolation limiting what members of an account can see.</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -1987,7 +1987,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Authorization","level":"2.5.1.3","depth":3,"next":{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},"previous":{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/authorization.md","mtime":"2019-05-20T19:15:37.408Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Authorization","level":"2.5.1.3","depth":3,"next":{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},"previous":{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/authorization.md","mtime":"2019-05-20T22:23:39.782Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1858,7 +1858,7 @@
|
||||
|
||||
<h2 id="nats-clients">NATS Clients</h2>
|
||||
<p>The nats-server doesn't come bundled with any clients. But most client libraries come with tools that allow you to publish, subscribe, send requests and reply messages.</p>
|
||||
<p>If you have a client library installed you can try using a bundled client. Otherwise you can easily install some clients.</p>
|
||||
<p>If you have a client library installed, you can try using a bundled client. Otherwise, you can easily install some clients.</p>
|
||||
<h3 id="if-you-have-go-installed">If you have Go installed:</h3>
|
||||
<pre class="language-"><code>> go get https://github.com/nats-io/go-nats-examples/tools/nats-pub
|
||||
> go get https://github.com/nats-io/go-nats-examples/tools/nats-sub
|
||||
@@ -1872,10 +1872,10 @@
|
||||
[29670] 2019/05/16 08:45:59.837161 [INF] Listening for client connections on 0.0.0.0:4222
|
||||
[29670] 2019/05/16 08:45:59.837168 [INF] Server id is NAYH35Q7ROQHLQ3K565JR4OPTJGO5EK4FJX6KX5IHHEPLQBRSYVWI2NO
|
||||
[29670] 2019/05/16 08:45:59.837170 [INF] Server is ready
|
||||
</code></pre><p>On another terminal start session start a subscriber:</p>
|
||||
</code></pre><p>On another terminal session start a subscriber:</p>
|
||||
<pre class="language-"><code>> nats-sub ">"
|
||||
Listening on [>]
|
||||
</code></pre><p>Note that when the client connected, the server didn't log anything interesting because server output is fairly quiet unless something interesting happens.</p>
|
||||
</code></pre><p>Note that when the client connected, the server didn't log anything interesting because server output is relatively quiet unless something interesting happens.</p>
|
||||
<p>To make the server output more lively, you can specify the <code>-V</code> flag to enable logging of server protocol tracing messages. Go ahead and <code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>ctrl</span><span class="token punctuation">></span></span>+c</code> the process running the server, and restart the server with the <code>-V</code> flag:</p>
|
||||
<pre class="language-"><code>> nats-server -V
|
||||
[29785] 2019/05/16 08:46:12.731278 [INF] Starting nats-server version 2.0.0
|
||||
@@ -1886,7 +1886,7 @@ Listening on [>]
|
||||
[29785] 2019/05/16 08:46:13.467099 [TRC] 127.0.0.1:49805 - cid:1 - <<- [CONNECT {"verbose":false,"pedantic":false,"tls_required":false,"name":"NATS Sample Subscriber","lang":"go","version":"1.7.0","protocol":1,"echo":true}]
|
||||
[29785] 2019/05/16 08:46:13.467200 [TRC] 127.0.0.1:49805 - cid:1 - <<- [PING]
|
||||
[29785] 2019/05/16 08:46:13.467206 [TRC] 127.0.0.1:49805 - cid:1 - ->> [PONG]
|
||||
</code></pre><p>If you had created a subscriber, you should notice output on the subscriber telling you that it diesconnected, and reconnected. The server output above is more interesting. You can see the subscriber send a <code>CONNECT</code> protocol message, and a <code>PING</code> which was responded to by the server with a <code>PONG</code>.</p>
|
||||
</code></pre><p>If you had created a subscriber, you should notice output on the subscriber telling you that it disconnected, and reconnected. The server output above is more interesting. You can see the subscriber send a <code>CONNECT</code> protocol message and a <code>PING</code> which was responded to by the server with a <code>PONG</code>.</p>
|
||||
<blockquote>
|
||||
<p>You can learn more about the <a href="../nats_protocol/nats-protocol.html">NATS protocol here</a>, but more intersting than the protocol description is <a href="../nats_protocol/nats-protocol-demo.html">an interactive demo</a>.</p>
|
||||
</blockquote>
|
||||
@@ -1896,7 +1896,7 @@ Published [hello] : 'world'
|
||||
</code></pre><p>On the subscriber window you should see:</p>
|
||||
<pre class="language-"><code>[#1] Received on [hello]: 'world'
|
||||
</code></pre><h3 id="testing-against-a-remote-server">Testing Against a Remote Server</h3>
|
||||
<p>If the NATS server was running in a different machine or a different port, you'll have to specify that to the client by specifying a <em>NATS URL</em>. NATS urls take the form of: <code>nats://<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>server</span><span class="token punctuation">></span></span>:<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>port</span><span class="token punctuation">></span></span></code> and <code>tls://<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>server</span><span class="token punctuation">></span></span>:<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>port</span><span class="token punctuation">></span></span></code>. URLs with a <code>tls</code> protocol sport a secured TLS connection.</p>
|
||||
<p>If the NATS server were running in a different machine or a different port, you'd have to specify that to the client by specifying a <em>NATS URL</em>. NATS URLs take the form of: <code>nats://<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>server</span><span class="token punctuation">></span></span>:<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>port</span><span class="token punctuation">></span></span></code> and <code>tls://<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>server</span><span class="token punctuation">></span></span>:<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>port</span><span class="token punctuation">></span></span></code>. URLs with a <code>tls</code> protocol sport a secured TLS connection.</p>
|
||||
<pre class="language-"><code>> nats-sub -s nats://server:port ">"
|
||||
</code></pre><p>If you want to try on a remote server, the NATS team maintains a demo server you can reach at <code>demo.nats.io</code>.</p>
|
||||
<pre class="language-"><code>> nats-sub -s nats://demo.nats.io ">"
|
||||
@@ -1943,7 +1943,7 @@ Published [hello] : 'world'
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Clients","level":"2.3","depth":1,"next":{"title":"Flags","level":"2.4","depth":1,"path":"nats_server/flags.md","ref":"nats_server/flags.md","articles":[]},"previous":{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/clients.md","mtime":"2019-05-16T14:42:57.087Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Clients","level":"2.3","depth":1,"next":{"title":"Flags","level":"2.4","depth":1,"path":"nats_server/flags.md","ref":"nats_server/flags.md","articles":[]},"previous":{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/clients.md","mtime":"2019-05-20T22:25:26.961Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1951,7 +1951,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.5.2.1","depth":3,"next":{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]},"previous":{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/cluster_config.md","mtime":"2019-05-20T15:25:20.667Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.5.2.1","depth":3,"next":{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]},"previous":{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/cluster_config.md","mtime":"2019-05-20T15:25:20.667Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1920,7 +1920,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"next":{"title":"Gateways","level":"2.5.3","depth":2,"path":"gateways/README.md","ref":"gateways/README.md","articles":[{"title":"Configuration","level":"2.5.3.1","depth":3,"path":"gateways/gateway.md","ref":"gateways/gateway.md","articles":[]}]},"previous":{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/cluster_tls.md","mtime":"2019-05-16T19:49:46.797Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"next":{"title":"Gateways","level":"2.5.3","depth":2,"path":"gateways/README.md","ref":"gateways/README.md","articles":[{"title":"Configuration","level":"2.5.3.1","depth":3,"path":"gateways/gateway.md","ref":"gateways/gateway.md","articles":[]}]},"previous":{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/cluster_tls.md","mtime":"2019-05-16T19:49:46.797Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -2024,7 +2024,7 @@ nats-pub -s <span class="token string">"nats://192.168.59.105:7222"</s
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Clustering","level":"2.5.2","depth":2,"next":{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},"previous":{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/clustering.md","mtime":"2019-05-20T21:38:53.379Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Clustering","level":"2.5.2","depth":2,"next":{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},"previous":{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/clustering.md","mtime":"2019-05-20T22:27:26.452Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1878,7 +1878,7 @@
|
||||
<li>values can be a primitive, or a list, or a map</li>
|
||||
<li>strings and numbers typically do the right thing</li>
|
||||
</ul>
|
||||
<p>String values that start with a number <em>can</em> create issues. To force such values as strings, simply quote them.</p>
|
||||
<p>String values that start with a digit <em>can</em> create issues. To force such values as strings, quote them.</p>
|
||||
<p><em>BAD Config</em>: </p>
|
||||
<pre class="language-"><code>listen: 127.0.0.1:4222
|
||||
authorization: {
|
||||
@@ -1894,7 +1894,7 @@ authorization: {
|
||||
<p>Server configurations can specify variables. Variables allow you to reference a value from one or more sections in the configuration. </p>
|
||||
<p>Variables:</p>
|
||||
<ul>
|
||||
<li>Are block scoped</li>
|
||||
<li>Are block-scoped</li>
|
||||
<li>Are referenced with a <code>$</code> prefix.</li>
|
||||
<li>Can be resolved from environment variables having the same name</li>
|
||||
</ul>
|
||||
@@ -1909,7 +1909,7 @@ authorization {
|
||||
token: $TOKEN
|
||||
}
|
||||
</code></pre><p>A similar configuration, but this time, the value is in the environment:</p>
|
||||
<pre class="language-"><code># TOKEN should be defined in the environment
|
||||
<pre class="language-"><code># TOKEN is defined in the environment
|
||||
authorization {
|
||||
token: $TOKEN
|
||||
}
|
||||
@@ -2061,7 +2061,7 @@ include ./auth.conf
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.5","depth":1,"next":{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},"previous":{"title":"Flags","level":"2.4","depth":1,"path":"nats_server/flags.md","ref":"nats_server/flags.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/configuration.md","mtime":"2019-05-20T16:39:40.893Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Configuration","level":"2.5","depth":1,"next":{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},"previous":{"title":"Flags","level":"2.4","depth":1,"path":"nats_server/flags.md","ref":"nats_server/flags.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/configuration.md","mtime":"2019-05-20T22:31:21.691Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,7 +1857,7 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h2 id="flags">Flags</h2>
|
||||
<p>The NATS server has many flags to customize its behaviour without having to write a configuration file.</p>
|
||||
<p>The NATS server has many flags to customize its behavior without having to write a configuration file.</p>
|
||||
<p>The configuration flags revolve around:</p>
|
||||
<ul>
|
||||
<li>Server Options</li>
|
||||
@@ -1915,7 +1915,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="authentication-options">Authentication Options</h3>
|
||||
<p>The following options control very simple authentication:</p>
|
||||
<p>The following options control straightforward authentication:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -2023,7 +2023,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align:left"><code>--routes</code></td>
|
||||
<td style="text-align:left">Comma separated list of cluster URLs to solicit and connect</td>
|
||||
<td style="text-align:left">Comma-separated list of cluster URLs to solicit and connect</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left"><code>--cluster</code></td>
|
||||
@@ -2110,7 +2110,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Flags","level":"2.4","depth":1,"next":{"title":"Configuration","level":"2.5","depth":1,"path":"nats_server/configuration.md","ref":"nats_server/configuration.md","articles":[{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},{"title":"Gateways","level":"2.5.3","depth":2,"path":"gateways/README.md","ref":"gateways/README.md","articles":[{"title":"Configuration","level":"2.5.3.1","depth":3,"path":"gateways/gateway.md","ref":"gateways/gateway.md","articles":[]}]},{"title":"Leaf Nodes","level":"2.5.4","depth":2,"path":"leafnodes/README.md","ref":"leafnodes/README.md","articles":[{"title":"Configuration","level":"2.5.4.1","depth":3,"path":"leafnodes/leafnode_conf.md","ref":"leafnodes/leafnode_conf.md","articles":[]}]},{"title":"Logging","level":"2.5.5","depth":2,"path":"nats_server/logging.md","ref":"nats_server/logging.md","articles":[]},{"title":"Monitoring","level":"2.5.6","depth":2,"path":"nats_server/monitoring.md","ref":"nats_server/monitoring.md","articles":[]}]},"previous":{"title":"Clients","level":"2.3","depth":1,"path":"nats_server/clients.md","ref":"nats_server/clients.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/flags.md","mtime":"2019-05-20T13:41:26.255Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Flags","level":"2.4","depth":1,"next":{"title":"Configuration","level":"2.5","depth":1,"path":"nats_server/configuration.md","ref":"nats_server/configuration.md","articles":[{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},{"title":"Gateways","level":"2.5.3","depth":2,"path":"gateways/README.md","ref":"gateways/README.md","articles":[{"title":"Configuration","level":"2.5.3.1","depth":3,"path":"gateways/gateway.md","ref":"gateways/gateway.md","articles":[]}]},{"title":"Leaf Nodes","level":"2.5.4","depth":2,"path":"leafnodes/README.md","ref":"leafnodes/README.md","articles":[{"title":"Configuration","level":"2.5.4.1","depth":3,"path":"leafnodes/leafnode_conf.md","ref":"leafnodes/leafnode_conf.md","articles":[]}]},{"title":"Logging","level":"2.5.5","depth":2,"path":"nats_server/logging.md","ref":"nats_server/logging.md","articles":[]},{"title":"Monitoring","level":"2.5.6","depth":2,"path":"nats_server/monitoring.md","ref":"nats_server/monitoring.md","articles":[]}]},"previous":{"title":"Clients","level":"2.3","depth":1,"path":"nats_server/clients.md","ref":"nats_server/clients.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/flags.md","mtime":"2019-05-20T22:30:33.728Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,7 +1857,7 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h2 id="nats-server-installation">NATS Server Installation</h2>
|
||||
<p>NATS philosophy is simplicity. Installation is just decompression a zip file and copying the binary to an appropiate directory; you can also use your favorite package manager.</p>
|
||||
<p>NATS philosophy is simplicity. Installation is just decompressing a zip file and copying the binary to an appropriate directory; you can also use your favorite package manager.</p>
|
||||
<h3 id="installing-via-a-package-manager">Installing via a Package Manager</h3>
|
||||
<p>On Windows:</p>
|
||||
<pre class="language-"><code>> choco install nats-server
|
||||
@@ -1867,7 +1867,7 @@
|
||||
<pre class="language-"><code>> docker pull nats-server:latest
|
||||
</code></pre><h3 id="installing-a-release-build">Installing A Release Build</h3>
|
||||
<p>You can find the latest release of nats-server <a href="https://github.com/nats-io/nats-server/releases/latest" target="_blank">here</a>.</p>
|
||||
<p>Simply download the zip file matching your systems architecture, and unzip. For this example, assuming version 2.0.0 of the server, and a Linux AMD64:</p>
|
||||
<p>Download the zip file matching your systems architecture, and unzip. For this example, assuming version 2.0.0 of the server, and a Linux AMD64:</p>
|
||||
<pre class="language-"><code>> curl -L https://github.com/nats-io/nats-server/releases/download/v2.0.0/nats-server-v2.0.0-linux-amd64.zip -o nats-server.zip
|
||||
|
||||
> unzip nats-server.zip -d nats-server
|
||||
@@ -1881,7 +1881,7 @@ Archive: nats-server.zip
|
||||
</code></pre><h3 id="installing-from-the-source">Installing from the source</h3>
|
||||
<p>If you have go installed, installing the binary is easy:</p>
|
||||
<pre class="language-"><code>> go get github.com/nats-io/nats-server
|
||||
</code></pre><p>This mechanism will install a build of <a href="https://github.com/nats-io/nats-server" target="_blank">master</a>, which almost certainly will not be a released version. If you are a developer and want to play with the the latest, this is the easiest way of obtaining it. </p>
|
||||
</code></pre><p>This mechanism will install a build of <a href="https://github.com/nats-io/nats-server" target="_blank">master</a>, which almost certainly will not be a released version. If you are a developer and want to play with the latest, this is the easiest way of obtaining it. </p>
|
||||
<h2 id="testing-your-installation">Testing Your Installation</h2>
|
||||
<p>To test your installation (provided the executable is visible to your shell):</p>
|
||||
<pre class="language-"><code>> nats-server
|
||||
@@ -1933,7 +1933,7 @@ Archive: nats-server.zip
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Installing","level":"2.1","depth":1,"next":{"title":"Running","level":"2.2","depth":1,"path":"nats_server/running.md","ref":"nats_server/running.md","articles":[{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]}]},"previous":{"title":"What's New in 2.0","level":"1.2","depth":1,"path":"whats_new/whats_new_20.md","ref":"whats_new/whats_new_20.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/installation.md","mtime":"2019-05-16T13:32:42.055Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Installing","level":"2.1","depth":1,"next":{"title":"Running","level":"2.2","depth":1,"path":"nats_server/running.md","ref":"nats_server/running.md","articles":[{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]}]},"previous":{"title":"What's New in 2.0","level":"1.2","depth":1,"path":"whats_new/whats_new_20.md","ref":"whats_new/whats_new_20.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/installation.md","mtime":"2019-05-20T22:31:14.159Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1961,7 +1961,7 @@ In simpler terms, more accounts with few (even one) clients is a better design t
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Accounts","level":"2.5.1.2.5","depth":4,"next":{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]},"previous":{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/jwt_auth.md","mtime":"2019-05-20T21:18:00.283Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Accounts","level":"2.5.1.2.5","depth":4,"next":{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]},"previous":{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/jwt_auth.md","mtime":"2019-05-20T21:18:00.283Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1958,7 +1958,7 @@ log_file: "/tmp/nats-server.log"
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Logging","level":"2.5.5","depth":2,"next":{"title":"Monitoring","level":"2.5.6","depth":2,"path":"nats_server/monitoring.md","ref":"nats_server/monitoring.md","articles":[]},"previous":{"title":"Configuration","level":"2.5.4.1","depth":3,"path":"leafnodes/leafnode_conf.md","ref":"leafnodes/leafnode_conf.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/logging.md","mtime":"2019-05-15T18:35:35.115Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Logging","level":"2.5.5","depth":2,"next":{"title":"Monitoring","level":"2.5.6","depth":2,"path":"nats_server/monitoring.md","ref":"nats_server/monitoring.md","articles":[]},"previous":{"title":"Configuration","level":"2.5.4.1","depth":3,"path":"leafnodes/leafnode_conf.md","ref":"leafnodes/leafnode_conf.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/logging.md","mtime":"2019-05-15T18:35:35.115Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -2041,7 +2041,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Monitoring","level":"2.5.6","depth":2,"next":{"title":"Managing A NATS Server","level":"2.6","depth":1,"path":"nats_admin/README.md","ref":"nats_admin/README.md","articles":[{"title":"Upgrading a Cluster","level":"2.6.1","depth":2,"path":"nats_admin/upgrading_cluster.md","ref":"nats_admin/upgrading_cluster.md","articles":[]},{"title":"Slow Consumers","level":"2.6.2","depth":2,"path":"nats_admin/slow_consumers.md","ref":"nats_admin/slow_consumers.md","articles":[]},{"title":"Signals","level":"2.6.3","depth":2,"path":"nats_admin/signals.md","ref":"nats_admin/signals.md","articles":[]},{"title":"System Accounts","level":"2.6.4","depth":2,"path":"sys_accounts/README.md","ref":"sys_accounts/README.md","articles":[{"title":"Configuration","level":"2.6.4.1","depth":3,"path":"sys_accounts/sys_accounts.md","ref":"sys_accounts/sys_accounts.md","articles":[]}]}]},"previous":{"title":"Logging","level":"2.5.5","depth":2,"path":"nats_server/logging.md","ref":"nats_server/logging.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/monitoring.md","mtime":"2019-05-20T21:25:00.569Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Monitoring","level":"2.5.6","depth":2,"next":{"title":"Managing A NATS Server","level":"2.6","depth":1,"path":"nats_admin/README.md","ref":"nats_admin/README.md","articles":[{"title":"Upgrading a Cluster","level":"2.6.1","depth":2,"path":"nats_admin/upgrading_cluster.md","ref":"nats_admin/upgrading_cluster.md","articles":[]},{"title":"Slow Consumers","level":"2.6.2","depth":2,"path":"nats_admin/slow_consumers.md","ref":"nats_admin/slow_consumers.md","articles":[]},{"title":"Signals","level":"2.6.3","depth":2,"path":"nats_admin/signals.md","ref":"nats_admin/signals.md","articles":[]},{"title":"System Accounts","level":"2.6.4","depth":2,"path":"sys_accounts/README.md","ref":"sys_accounts/README.md","articles":[{"title":"Configuration","level":"2.6.4.1","depth":3,"path":"sys_accounts/sys_accounts.md","ref":"sys_accounts/sys_accounts.md","articles":[]}]}]},"previous":{"title":"Logging","level":"2.5.5","depth":2,"path":"nats_server/logging.md","ref":"nats_server/logging.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/monitoring.md","mtime":"2019-05-20T21:25:00.569Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,10 +1857,10 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h2 id="nkey-authentication">NKey Authentication</h2>
|
||||
<p>NKeys are a new highly secure public-key signature system based on <a href="https://ed25519.cr.yp.to/" target="_blank">Ed25519</a>.</p>
|
||||
<p>NKeys are a new, highly secure public-key signature system based on <a href="https://ed25519.cr.yp.to/" target="_blank">Ed25519</a>.</p>
|
||||
<p>With NKeys the server can verify identities without ever storing secrets on the server. The authentication system works by requiring a connecting client to provide its public key and digitally sign a challenge with its private key. The server generates a random challenge with every connection request, making it immune to playback attacks. The generated signature is validated against the provided public key, thus proving the identity of the client. If the public key is known to the server, authentication succeeds.</p>
|
||||
<blockquote>
|
||||
<p>NKey is an awesome replacement for token authentication, because a connecting client will have to prove it controls the private key for the authorized public key.</p>
|
||||
<p>NKey is an excellent replacement for token authentication because a connecting client will have to prove it controls the private key for the authorized public key.</p>
|
||||
</blockquote>
|
||||
<p>To generate nkeys, you'll need the <a href="../nats_tools/nk.html"><code>nk</code> tool</a>.</p>
|
||||
<h3 id="generating-nkeys-and-configuring-the-server">Generating NKeys and Configuring the Server</h3>
|
||||
@@ -1868,9 +1868,9 @@
|
||||
<pre class="language-"><code>> nk -gen user -pubout
|
||||
SUACSSL3UAHUDXKFSNVUZRF5UHPMWZ6BFDTJ7M6USDXIEDNPPQYYYCU3VY
|
||||
UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4
|
||||
</code></pre><p>The first output line starts with the letter <code>S</code> for <em>Seed</em>. The second letter <code>U</code> stands for <em>User</em>. Seeds are private keys; you should treat them as secrets and guard them with care.</p>
|
||||
<p>The second line starts with the letter <code>U</code> for <em>User</em>, and is a public key which can be safely shared.</p>
|
||||
<p>To use nkey authentication, add a user and set the <code>nkey</code> property to the public key of the user you want to authenticate:</p>
|
||||
</code></pre><p>The first output line starts with the letter <code>S</code> for <em>Seed</em>. The second letter, <code>U</code> stands for <em>User</em>. Seeds are private keys; you should treat them as secrets and guard them with care.</p>
|
||||
<p>The second line starts with the letter <code>U</code> for <em>User</em> and is a public key which can be safely shared.</p>
|
||||
<p>To use nkey authentication, add a user, and set the <code>nkey</code> property to the public key of the user you want to authenticate:</p>
|
||||
<pre class="language-"><code class="lang-text">authorization: {
|
||||
users: [
|
||||
{ nkey: UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4 }
|
||||
@@ -1879,9 +1879,9 @@ UDXU4RCSJNZOIQHZNWXHXORDPRTGNJAHAHFRGZNEEJCPQTT2M7NLCNF4
|
||||
</code></pre>
|
||||
<p>Note that the user section sets the <code>nkey</code> property (user/password/token properties are not needed). Add <code>permission</code> sections as required.</p>
|
||||
<h3 id="client-configuration">Client Configuration</h3>
|
||||
<p>Now that you have a user nkey let's configure a client to use it for authentication. As an example, here are the connect options for the node client:</p>
|
||||
<pre class="language-"><code class="lang-javascript"><span class="token keyword">const</span> <span class="token constant">NATS</span> <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span>‘nats‘<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">const</span> nkeys <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span>'ts<span class="token operator">-</span>nkeys’<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<p>Now that you have a user nkey, let's configure a client to use it for authentication. As an example, here are the connect options for the node client:</p>
|
||||
<pre class="language-"><code class="lang-javascript"><span class="token keyword">const</span> <span class="token constant">NATS</span> <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'nats'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">const</span> nkeys <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'ts-nkeys'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">const</span> nkey_seed <span class="token operator">=</span> ‘<span class="token constant">SUACSSL3UAHUDXKFSNVUZRF5UHPMWZ6BFDTJ7M6USDXIEDNPPQYYYCU3VY</span>’<span class="token punctuation">;</span>
|
||||
<span class="token keyword">const</span> nc <span class="token operator">=</span> <span class="token constant">NATS</span><span class="token punctuation">.</span><span class="token function">connect</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
|
||||
@@ -1946,7 +1946,7 @@ our <a href="https://nats.io/documentation/writing_applications/secure_connectio
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"NKeys","level":"2.5.1.2.4","depth":4,"next":{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},"previous":{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/nkey_auth.md","mtime":"2019-05-16T21:41:49.510Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"NKeys","level":"2.5.1.2.4","depth":4,"next":{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},"previous":{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/nkey_auth.md","mtime":"2019-05-20T22:44:12.881Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1859,7 +1859,7 @@
|
||||
<h2 id="running">Running</h2>
|
||||
<p>The nats-server has many command line options. To get started, you don't have to specify anything.
|
||||
In the absence of any flags, the NATS server will start listening for NATS client connections on port 4222.
|
||||
By default, security is not enabled.</p>
|
||||
By default, security is disabled.</p>
|
||||
<h3 id="standalone">Standalone</h3>
|
||||
<p>When the server starts it will print some information including where the server is listening for client connections:</p>
|
||||
<pre class="language-"><code>> nats-server
|
||||
@@ -1922,7 +1922,7 @@ By default, security is not enabled.</p>
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Running","level":"2.2","depth":1,"next":{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]},"previous":{"title":"Installing","level":"2.1","depth":1,"path":"nats_server/installation.md","ref":"nats_server/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/running.md","mtime":"2019-05-20T17:42:18.154Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Running","level":"2.2","depth":1,"next":{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]},"previous":{"title":"Installing","level":"2.1","depth":1,"path":"nats_server/installation.md","ref":"nats_server/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/running.md","mtime":"2019-05-20T22:42:25.353Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1906,7 +1906,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Securing NATS","level":"2.5.1","depth":2,"next":{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},"previous":{"title":"Configuration","level":"2.5","depth":1,"path":"nats_server/configuration.md","ref":"nats_server/configuration.md","articles":[{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},{"title":"Gateways","level":"2.5.3","depth":2,"path":"gateways/README.md","ref":"gateways/README.md","articles":[{"title":"Configuration","level":"2.5.3.1","depth":3,"path":"gateways/gateway.md","ref":"gateways/gateway.md","articles":[]}]},{"title":"Leaf Nodes","level":"2.5.4","depth":2,"path":"leafnodes/README.md","ref":"leafnodes/README.md","articles":[{"title":"Configuration","level":"2.5.4.1","depth":3,"path":"leafnodes/leafnode_conf.md","ref":"leafnodes/leafnode_conf.md","articles":[]}]},{"title":"Logging","level":"2.5.5","depth":2,"path":"nats_server/logging.md","ref":"nats_server/logging.md","articles":[]},{"title":"Monitoring","level":"2.5.6","depth":2,"path":"nats_server/monitoring.md","ref":"nats_server/monitoring.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/securing_nats.md","mtime":"2019-05-20T19:29:03.072Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Securing NATS","level":"2.5.1","depth":2,"next":{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},"previous":{"title":"Configuration","level":"2.5","depth":1,"path":"nats_server/configuration.md","ref":"nats_server/configuration.md","articles":[{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},{"title":"Clustering","level":"2.5.2","depth":2,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[{"title":"Configuration","level":"2.5.2.1","depth":3,"path":"nats_server/cluster_config.md","ref":"nats_server/cluster_config.md","articles":[]},{"title":"TLS Authentication","level":"2.5.2.2","depth":3,"path":"nats_server/cluster_tls.md","ref":"nats_server/cluster_tls.md","articles":[]}]},{"title":"Gateways","level":"2.5.3","depth":2,"path":"gateways/README.md","ref":"gateways/README.md","articles":[{"title":"Configuration","level":"2.5.3.1","depth":3,"path":"gateways/gateway.md","ref":"gateways/gateway.md","articles":[]}]},{"title":"Leaf Nodes","level":"2.5.4","depth":2,"path":"leafnodes/README.md","ref":"leafnodes/README.md","articles":[{"title":"Configuration","level":"2.5.4.1","depth":3,"path":"leafnodes/leafnode_conf.md","ref":"leafnodes/leafnode_conf.md","articles":[]}]},{"title":"Logging","level":"2.5.5","depth":2,"path":"nats_server/logging.md","ref":"nats_server/logging.md","articles":[]},{"title":"Monitoring","level":"2.5.6","depth":2,"path":"nats_server/monitoring.md","ref":"nats_server/monitoring.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/securing_nats.md","mtime":"2019-05-20T19:29:03.072Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,7 +1857,7 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h2 id="tls-configuration">TLS Configuration</h2>
|
||||
<p>The NATS server uses modern TLS semantics to encrypt client, route and monitoring connections.
|
||||
<p>The NATS server uses modern TLS semantics to encrypt client, route, and monitoring connections.
|
||||
Server configuration revolves around a <code>tls</code> map, which has the following properties:</p>
|
||||
<table>
|
||||
<thead>
|
||||
@@ -1877,15 +1877,15 @@ Server configuration revolves around a <code>tls</code> map, which has the follo
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left"><code>cipher_suites</code></td>
|
||||
<td style="text-align:left">When set, only the specified TLS cipher suites will be allowed. Values must match golang version used to build the server.</td>
|
||||
<td style="text-align:left">When set, only the specified TLS cipher suites will be allowed. Values must match the golang version used to build the server.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left"><code>curve_preferences</code></td>
|
||||
<td style="text-align:left">List of TLS cypher curves to use in order.</td>
|
||||
<td style="text-align:left">List of TLS cipher curves to use in order.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left"><code>insecure</code></td>
|
||||
<td style="text-align:left">Skip certificate verfication.</td>
|
||||
<td style="text-align:left">Skip certificate verification.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left"><code>key_file</code></td>
|
||||
@@ -1923,9 +1923,9 @@ Server configuration revolves around a <code>tls</code> map, which has the follo
|
||||
[22242] 2019/05/16 11:22:20.216539 [DBG] 127.0.0.1:51383 - cid:1 - Starting TLS client connection handshake
|
||||
[22242] 2019/05/16 11:22:20.367275 [DBG] 127.0.0.1:51383 - cid:1 - TLS handshake complete
|
||||
[22242] 2019/05/16 11:22:20.367291 [DBG] 127.0.0.1:51383 - cid:1 - TLS version 1.2, cipher suite TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
|
||||
</code></pre><p>When a <code>tls</code> section is specified at the root of the configuration it also affects the monitoring port if <code>https_port</code> option is specified. Other sections such as <code>cluster</code> can specify a <code>tls</code> block.</p>
|
||||
</code></pre><p>When a <code>tls</code> section is specified at the root of the configuration, it also affects the monitoring port if <code>https_port</code> option is specified. Other sections such as <code>cluster</code> can specify a <code>tls</code> block.</p>
|
||||
<h3 id="tls-timeout">TLS Timeout</h3>
|
||||
<p>The <code>timeout</code> setting enables you to control the amount of time that a client is allowed to upgrade its connection to tls. If your clients are experiencing disconnects during TLS handshake, you'll want to increase the value. However if you do be aware that a long <code>timeout</code> exposes your server to attacks where a client doesn't upgrade to TLS and thus consumes resources. Conversely, if you reduce the TLS <code>timeout</code> too much, you are likely to experience handshake errors.</p>
|
||||
<p>The <code>timeout</code> setting enables you to control the amount of time that a client is allowed to upgrade its connection to tls. If your clients are experiencing disconnects during TLS handshake, you'll want to increase the value, however, if you do be aware that an extended <code>timeout</code> exposes your server to attacks where a client doesn't upgrade to TLS and thus consumes resources. Conversely, if you reduce the TLS <code>timeout</code> too much, you are likely to experience handshake errors.</p>
|
||||
<pre class="language-"><code>tls: {
|
||||
cert_file: "./server-cert.pem"
|
||||
key_file: "./server-key.pem"
|
||||
@@ -1975,7 +1975,7 @@ Server configuration revolves around a <code>tls</code> map, which has the follo
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"next":{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},"previous":{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/tls.md","mtime":"2019-05-20T14:42:04.094Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"next":{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},"previous":{"title":"Securing NATS","level":"2.5.1","depth":2,"path":"nats_server/securing_nats.md","ref":"nats_server/securing_nats.md","articles":[{"title":"Enabling TLS","level":"2.5.1.1","depth":3,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},{"title":"Authorization","level":"2.5.1.3","depth":3,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/tls.md","mtime":"2019-05-20T22:44:08.192Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,13 +1857,13 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h2 id="client-tls-mutual-authentication">Client TLS Mutual Authentication</h2>
|
||||
<p>The server can require TLS certificates from a client. When required, you can use the certificates to:</p>
|
||||
<p>The server can require TLS certificates from a client. When needed, you can use the certificates to:</p>
|
||||
<ul>
|
||||
<li>Validate the client certificate matches a known or trusted CA</li>
|
||||
<li>Extract information from a trusted certificate to provide authentication</li>
|
||||
</ul>
|
||||
<h3 id="validating-a-client-certificate">Validating a Client Certificate</h3>
|
||||
<p>The server can verify a client certificate using CA certificate. To require verification, simply add the option <code>verify</code> the TLS configuration section as follows:</p>
|
||||
<p>The server can verify a client certificate using a CA certificate. To require verification, add the option <code>verify</code> the TLS configuration section as follows:</p>
|
||||
<pre class="language-"><code>tls {
|
||||
cert_file: "./configs/certs/server-cert.pem"
|
||||
key_file: "./configs/certs/server-key.pem"
|
||||
@@ -1873,10 +1873,10 @@
|
||||
</code></pre><p>Or via the command line:</p>
|
||||
<pre class="language-"><code class="lang-sh"><span class="token operator">></span> ./nats-server --tlsverify --tlscert<span class="token operator">=</span>./test/configs/certs/server-cert.pem --tlskey<span class="token operator">=</span>./test/configs/certs/server-key.pem --tlscacert<span class="token operator">=</span>./test/configs/certs/ca.pem
|
||||
</code></pre>
|
||||
<p>This option simply verifies the client's certificate has been signed by the CA specified in the <code>ca_file</code> option. </p>
|
||||
<p>This option verifies the client's certificate is signed by the CA specified in the <code>ca_file</code> option. </p>
|
||||
<h2 id="mapping-client-certificates-to-a-user">Mapping Client Certificates To A User</h2>
|
||||
<p>In addition to verifying that a client certificate was issued by a specified CA, you can use information encoded in the certificate to authenticate a client. The client wouldn't have to provide or track usernames or passwords.</p>
|
||||
<p>To have TLS Mutual Authentication map certificate attributes to the users identity use <code>verify_and_map</code> as shown as follows:</p>
|
||||
<p>In addition to verifying that a specified CA issued a client certificate, you can use information encoded in the certificate to authenticate a client. The client wouldn't have to provide or track usernames or passwords.</p>
|
||||
<p>To have TLS Mutual Authentication map certificate attributes to the user's identity use <code>verify_and_map</code> as shown as follows:</p>
|
||||
<pre class="language-"><code>tls {
|
||||
cert_file: "./configs/certs/server-cert.pem"
|
||||
key_file: "./configs/certs/server-key.pem"
|
||||
@@ -1964,7 +1964,7 @@ Certificate:
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"next":{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},"previous":{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/tls_mutual_auth.md","mtime":"2019-05-20T13:48:38.838Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"next":{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},"previous":{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/tls_mutual_auth.md","mtime":"2019-05-20T22:46:32.178Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,8 +1857,8 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h1 id="token-authentication">Token Authentication</h1>
|
||||
<p>Token authentication is a string that if provided by a client, allows it to connect. It is the simplest authentication provided by the NATS server. </p>
|
||||
<p>To use token authentication, you can just specify an <code>authorization</code> section with the <code>token</code> property set:</p>
|
||||
<p>Token authentication is a string that if provided by a client, allows it to connect. It is the most straightforward authentication provided by the NATS server. </p>
|
||||
<p>To use token authentication, you can specify an <code>authorization</code> section with the <code>token</code> property set:</p>
|
||||
<pre class="language-"><code>authorization {
|
||||
token: "s3cr3t"
|
||||
}
|
||||
@@ -1869,7 +1869,7 @@
|
||||
<pre class="language-"><code>> nats-sub -s nats://s3cr3t@localhost:4222 ">"
|
||||
Listening on [>]
|
||||
</code></pre><h2 id="bcrypted-tokens">Bcrypted Tokens</h2>
|
||||
<p>Tokens can be bcrypted enabling an additional layer of security, as the clear-text version of the token would not be persisted on server configuration file.</p>
|
||||
<p>Tokens can be bcrypted enabling an additional layer of security, as the clear-text version of the token would not be persisted on the server configuration file.</p>
|
||||
<p>You can generate bcrypted tokens and passwords using the <a href="../nats_tools/mkpasswd.html"><code>mkpasswd</code></a> tool:</p>
|
||||
<pre class="language-"><code>> mkpasswd
|
||||
pass: dag0HTXl4RGg7dXdaJwbC8
|
||||
@@ -1924,7 +1924,7 @@ Listening on [>]
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Tokens","level":"2.5.1.2.1","depth":4,"next":{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},"previous":{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/tokens.md","mtime":"2019-05-20T13:46:24.886Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Tokens","level":"2.5.1.2.1","depth":4,"next":{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},"previous":{"title":"Authentication","level":"2.5.1.2","depth":3,"path":"nats_server/auth_intro.md","ref":"nats_server/auth_intro.md","articles":[{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"path":"nats_server/username_password.md","ref":"nats_server/username_password.md","articles":[]},{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},{"title":"NKeys","level":"2.5.1.2.4","depth":4,"path":"nats_server/nkey_auth.md","ref":"nats_server/nkey_auth.md","articles":[]},{"title":"Accounts","level":"2.5.1.2.5","depth":4,"path":"nats_server/jwt_auth.md","ref":"nats_server/jwt_auth.md","articles":[]},{"title":"Authentication Timeout","level":"2.5.1.2.6","depth":4,"path":"nats_server/auth_timeout.md","ref":"nats_server/auth_timeout.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/tokens.md","mtime":"2019-05-20T22:47:43.236Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,7 +1857,7 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h1 id="username-and-password">Username and Password</h1>
|
||||
<p>You can authenticate one or more clients using username and passwords. This enables you to have greater control on the management and issuing of credential secrets.</p>
|
||||
<p>You can authenticate one or more clients using username and passwords; this enables you to have greater control over the management and issuing of credential secrets.</p>
|
||||
<p>For a single user:</p>
|
||||
<pre class="language-"><code>authorization: {
|
||||
user: a,
|
||||
@@ -1885,7 +1885,7 @@ bcrypt hash: $2a$11$V1qrpBt8/SLfEBr4NJq4T.2mg8chx8.MTblUiTBOLV3MKDeAy.f7u
|
||||
]
|
||||
}
|
||||
</code></pre><h2 id="reloading-a-configuration">Reloading a Configuration</h2>
|
||||
<p>As you add/remove passwords from the server configuration file, you'll want your changes to take effect. To reload without restarting the server and disconnecting clients, simply do:</p>
|
||||
<p>As you add/remove passwords from the server configuration file, you'll want your changes to take effect. To reload without restarting the server and disconnecting clients, do:</p>
|
||||
<pre class="language-"><code>> nats-server --signal reload
|
||||
</code></pre>
|
||||
|
||||
@@ -1930,7 +1930,7 @@ bcrypt hash: $2a$11$V1qrpBt8/SLfEBr4NJq4T.2mg8chx8.MTblUiTBOLV3MKDeAy.f7u
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"next":{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},"previous":{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/username_password.md","mtime":"2019-05-20T16:39:54.763Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Username/Password","level":"2.5.1.2.2","depth":4,"next":{"title":"TLS Authentication","level":"2.5.1.2.3","depth":4,"path":"nats_server/tls_mutual_auth.md","ref":"nats_server/tls_mutual_auth.md","articles":[]},"previous":{"title":"Tokens","level":"2.5.1.2.1","depth":4,"path":"nats_server/tokens.md","ref":"nats_server/tokens.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/username_password.md","mtime":"2019-05-20T22:48:28.794Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -1857,11 +1857,11 @@
|
||||
<section class="normal markdown-section">
|
||||
|
||||
<h3 id="windows-service">Windows Service</h3>
|
||||
<p>The NATS server supports running as a Windows service. In fact, this is the recommended way of running NATS on Windows. There is currently no installer and instead users should use <code>sc.exe</code> to install the service:</p>
|
||||
<p>The NATS server supports running as a Windows service. In fact, this is the recommended way of running NATS on Windows. There is currently no installer; users should use <code>sc.exe</code> to install the service:</p>
|
||||
<pre class="language-"><code class="lang-batch"><span class="token command"><span class="token keyword">sc</span>.exe create nats-server binPath= <span class="token string">"%NATS_PATH%\nats-server.exe [nats-server flags]"</span></span>
|
||||
<span class="token command"><span class="token keyword">sc</span>.exe start nats-server</span>
|
||||
</code></pre>
|
||||
<p>The above will create and start a <code>nats-server</code> service. Note that the nats-server flags should be passed in when creating the service. This allows for running multiple NATS server configurations on a single Windows server by using a 1:1 service instance per installed NATS server service. Once the service is running, it can be controlled using <code>sc.exe</code> or <code>nats-server.exe --signal</code>:</p>
|
||||
<p>The above will create and start a <code>nats-server</code> service. Note that the nats-server flags should be provided when creating the service. This allows for running multiple NATS server configurations on a single Windows server by using a 1:1 service instance per installed NATS server service. Once the service is running, it can be controlled using <code>sc.exe</code> or <code>nats-server.exe --signal</code>:</p>
|
||||
<pre class="language-"><code class="lang-batch"><span class="token comment">REM Reload server configuration</span>
|
||||
<span class="token command"><span class="token keyword">nats</span>-server.exe <span class="token parameter attr-name">--signal</span> reload</span>
|
||||
|
||||
@@ -1918,7 +1918,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"Window Service","level":"2.2.1","depth":2,"next":{"title":"Clients","level":"2.3","depth":1,"path":"nats_server/clients.md","ref":"nats_server/clients.md","articles":[]},"previous":{"title":"Running","level":"2.2","depth":1,"path":"nats_server/running.md","ref":"nats_server/running.md","articles":[{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/windows_srv.md","mtime":"2019-05-16T14:06:07.915Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:00:46.477Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"Window Service","level":"2.2.1","depth":2,"next":{"title":"Clients","level":"2.3","depth":1,"path":"nats_server/clients.md","ref":"nats_server/clients.md","articles":[]},"previous":{"title":"Running","level":"2.2","depth":1,"path":"nats_server/running.md","ref":"nats_server/running.md","articles":[{"title":"Window Service","level":"2.2.1","depth":2,"path":"nats_server/windows_srv.md","ref":"nats_server/windows_srv.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html","toggle-chapters"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{"lang":{"ascii":"markup","text":"markup"}},"include-html":{},"toggle-chapters":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/windows_srv.md","mtime":"2019-05-20T22:16:24.133Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-20T22:49:57.562Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user