mirror of
				https://github.com/taigrr/nats.docs
				synced 2025-01-18 04:03:23 -08:00 
			
		
		
		
	
		
			
				
	
	
		
			3324 lines
		
	
	
		
			109 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			3324 lines
		
	
	
		
			109 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
 | 
						|
<!DOCTYPE HTML>
 | 
						|
<html lang="" >
 | 
						|
    <head>
 | 
						|
        <meta charset="UTF-8">
 | 
						|
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
 | 
						|
        <title>Basics ยท NATS</title>
 | 
						|
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 | 
						|
        <meta name="description" content="">
 | 
						|
        <meta name="generator" content="GitBook 3.2.3">
 | 
						|
        <meta name="author" content="The NATS Maintainers">
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
    <link rel="stylesheet" href="../../gitbook/style.css">
 | 
						|
 | 
						|
    
 | 
						|
            
 | 
						|
                
 | 
						|
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism.css">
 | 
						|
                
 | 
						|
            
 | 
						|
                
 | 
						|
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
 | 
						|
                
 | 
						|
            
 | 
						|
                
 | 
						|
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchors/plugin.css">
 | 
						|
                
 | 
						|
            
 | 
						|
                
 | 
						|
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
 | 
						|
                
 | 
						|
            
 | 
						|
                
 | 
						|
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
 | 
						|
                
 | 
						|
            
 | 
						|
        
 | 
						|
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
    
 | 
						|
 | 
						|
        
 | 
						|
 | 
						|
    
 | 
						|
    
 | 
						|
    <meta name="HandheldFriendly" content="true"/>
 | 
						|
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
 | 
						|
    <meta name="apple-mobile-web-app-capable" content="yes">
 | 
						|
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
 | 
						|
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
 | 
						|
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
 | 
						|
 | 
						|
    
 | 
						|
    <link rel="next" href="streams.html" />
 | 
						|
    
 | 
						|
    
 | 
						|
    <link rel="prev" href="./" />
 | 
						|
    
 | 
						|
 | 
						|
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css">
 | 
						|
 | 
						|
    </head>
 | 
						|
    <body>
 | 
						|
        
 | 
						|
 | 
						|
<div class="book">
 | 
						|
    <div class="book-summary">
 | 
						|
        
 | 
						|
            
 | 
						|
<div id="book-search-input" role="search">
 | 
						|
    <input type="text" placeholder="Type to search" />
 | 
						|
</div>
 | 
						|
 | 
						|
            
 | 
						|
                <nav role="navigation">
 | 
						|
                
 | 
						|
 | 
						|
 | 
						|
<ul class="summary">
 | 
						|
    
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="1.1" data-path="../../">
 | 
						|
            
 | 
						|
                <a href="../../">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Introduction
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="1.2" data-path="../../whats_new/whats_new_20.html">
 | 
						|
            
 | 
						|
                <a href="../../whats_new/whats_new_20.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    What's New in 2.0
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="1.3" data-path="../../faq.html">
 | 
						|
            
 | 
						|
                <a href="../../faq.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    FAQ
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="1.4" >
 | 
						|
            
 | 
						|
                <a target="_blank" href="https://nats.io">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    nats.io
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">Concepts</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="2.1" data-path="../../developer/concepts/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/concepts/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    What is NATS
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="2.2" data-path="../../developer/concepts/subjects.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/concepts/subjects.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Subject-Based Messaging
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="2.3" data-path="../../developer/concepts/pubsub.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/concepts/pubsub.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Publish-Subscribe
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="2.4" data-path="../../developer/concepts/reqreply.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/concepts/reqreply.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Request-Reply
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="2.5" data-path="../../developer/concepts/queue.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/concepts/queue.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Queue Groups
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="2.6" data-path="../../developer/concepts/acks.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/concepts/acks.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Acknowledgements
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="2.7" data-path="../../developer/concepts/seq_num.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/concepts/seq_num.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Sequence Numbers
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">Developing With NATS</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.1" data-path="../../developer/">
 | 
						|
            
 | 
						|
                <a href="../../developer/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Introduction
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2" data-path="../../developer/connecting/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Connecting
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2.1" data-path="../../developer/connecting/default_server.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/default_server.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Connecting to the Default Server
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2.2" data-path="../../developer/connecting/specific_server.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/specific_server.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Connecting to a Specific Server
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2.3" data-path="../../developer/connecting/cluster.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/cluster.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Connecting to a Cluster
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2.4" data-path="../../developer/connecting/connect_timeout.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/connect_timeout.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Setting a Connect Timeout
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2.5" data-path="../../developer/connecting/pingpong.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/pingpong.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Ping/Pong Protocol
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2.6" data-path="../../developer/connecting/protocol.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/protocol.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Controlling the Client/Server Protocol
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.2.7" data-path="../../developer/connecting/noecho.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/connecting/noecho.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Turning Off Echo'd Messages
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.3" data-path="../../developer/reconnect/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/reconnect/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Automatic Reconnections
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.3.1" data-path="../../developer/reconnect/disable.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/reconnect/disable.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Disabling Reconnect
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.3.2" data-path="../../developer/reconnect/max.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/reconnect/max.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Set the Number of Reconnect Attempts
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.3.3" data-path="../../developer/reconnect/wait.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/reconnect/wait.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Pausing Between Reconnect Attempts
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.3.4" data-path="../../developer/reconnect/random.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/reconnect/random.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Avoiding the Thundering Herd
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.3.5" data-path="../../developer/reconnect/events.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/reconnect/events.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Listening for Reconnect Events
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.3.6" data-path="../../developer/reconnect/buffer.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/reconnect/buffer.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Buffering Messages During Reconnect Attempts
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.4" data-path="../../developer/security/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/security/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Securing Connections
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.4.1" data-path="../../developer/security/userpass.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/security/userpass.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authenticating with a User and Password
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.4.2" data-path="../../developer/security/token.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/security/token.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authenticating with a Token
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.4.3" data-path="../../developer/security/nkey.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/security/nkey.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authenticating with an NKey
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.4.4" data-path="../../developer/security/creds.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/security/creds.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authenticating with a Credentials File
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.4.5" data-path="../../developer/security/tls.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/security/tls.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Encrypting Connections with TLS
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5" data-path="../../developer/receiving/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Receiving Messages
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.1" data-path="../../developer/receiving/sync.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/sync.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Synchronous Subscriptions
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.2" data-path="../../developer/receiving/async.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/async.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Asynchronous Subscriptions
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.3" data-path="../../developer/receiving/unsubscribing.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/unsubscribing.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Unsubscribing
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.4" data-path="../../developer/receiving/unsub_after.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/unsub_after.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Unsubscribing After N Messages
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.5" data-path="../../developer/receiving/reply.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/reply.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Replying to a Message
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.6" data-path="../../developer/receiving/wildcards.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/wildcards.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Wildcard Subscriptions
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.7" data-path="../../developer/receiving/queues.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/queues.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Queue Subscriptions
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.8" data-path="../../developer/receiving/drain.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/drain.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Draining Messages Before Disconnect
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.5.9" data-path="../../developer/receiving/structure.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/receiving/structure.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Structured Data
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.6" data-path="../../developer/sending/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/sending/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Sending Messages
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.6.1" data-path="../../developer/sending/replyto.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/sending/replyto.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Including a Reply Subject
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.6.2" data-path="../../developer/sending/request_reply.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/sending/request_reply.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Request-Reply Semantics
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.6.3" data-path="../../developer/sending/caches.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/sending/caches.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Caches, Flush and Ping
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.6.4" data-path="../../developer/sending/structure.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/sending/structure.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Sending Structured Data
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.7" data-path="../../developer/events/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/events/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Monitoring the Connection
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.7.1" data-path="../../developer/events/events.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/events/events.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Listen for Connection Events
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.7.2" data-path="../../developer/events/slow.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/events/slow.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Slow Consumers
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.8" data-path="../../developer/tutorials/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/tutorials/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Tutorials
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.8.1" data-path="../../developer/tutorials/pubsub.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/tutorials/pubsub.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Explore NATS Pub/Sub
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.8.2" data-path="../../developer/tutorials/reqreply.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/tutorials/reqreply.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Explore NATS Request/Reply
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.8.3" data-path="../../developer/tutorials/queues.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/tutorials/queues.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Explore NATS Queueing
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="3.8.4" data-path="../../developer/tutorials/custom_dialer.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/tutorials/custom_dialer.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Advanced Connect and Custom Dialer in Go
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">NATS Server</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.1" data-path="../../nats_server/installation.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/installation.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Installing
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.2" data-path="../../nats_server/running.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/running.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Running
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.2.1" data-path="../../nats_server/windows_srv.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/windows_srv.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Window Service
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.3" data-path="../../nats_server/clients.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/clients.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Clients
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.4" data-path="../../nats_server/flags.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/flags.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Flags
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5" data-path="../../nats_server/configuration.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/configuration.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuration
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1" data-path="../../nats_server/securing_nats.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/securing_nats.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Securing NATS
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.1" data-path="../../nats_server/tls.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/tls.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Enabling TLS
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2" data-path="../../nats_server/auth_intro.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/auth_intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authentication
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2.1" data-path="../../nats_server/tokens.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/tokens.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Tokens
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2.2" data-path="../../nats_server/username_password.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/username_password.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Username/Password
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2.3" data-path="../../nats_server/tls_mutual_auth.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/tls_mutual_auth.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    TLS Authentication
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2.4" data-path="../../nats_server/nkey_auth.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/nkey_auth.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    NKeys
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2.5" data-path="../../nats_server/accounts.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/accounts.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Accounts
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2.6" data-path="../../nats_server/jwt_auth.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/jwt_auth.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    JWTs
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.2.7" data-path="../../nats_server/auth_timeout.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/auth_timeout.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authentication Timeout
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.1.3" data-path="../../nats_server/authorization.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/authorization.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authorization
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.2" data-path="../../nats_server/clustering.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/clustering.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Clustering
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.2.1" data-path="../../nats_server/cluster_config.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/cluster_config.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuration
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.2.2" data-path="../../nats_server/cluster_tls.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/cluster_tls.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    TLS Authentication
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.3" data-path="../../gateways/">
 | 
						|
            
 | 
						|
                <a href="../../gateways/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Gateways
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.3.1" data-path="../../gateways/gateway.html">
 | 
						|
            
 | 
						|
                <a href="../../gateways/gateway.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuration
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.4" data-path="../../leafnodes/">
 | 
						|
            
 | 
						|
                <a href="../../leafnodes/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Leaf Nodes
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.4.1" data-path="../../leafnodes/leafnode_conf.html">
 | 
						|
            
 | 
						|
                <a href="../../leafnodes/leafnode_conf.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuration
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.5" data-path="../../nats_server/logging.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/logging.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Logging
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.5.6" data-path="../../nats_server/monitoring.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_server/monitoring.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Monitoring
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.6" data-path="../../nats_admin/">
 | 
						|
            
 | 
						|
                <a href="../../nats_admin/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Managing A NATS Server
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.6.1" data-path="../../nats_admin/upgrading_cluster.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_admin/upgrading_cluster.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Upgrading a Cluster
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.6.2" data-path="../../nats_admin/slow_consumers.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_admin/slow_consumers.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Slow Consumers
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.6.3" data-path="../../nats_admin/signals.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_admin/signals.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Signals
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.6.4" data-path="../../sys_accounts/">
 | 
						|
            
 | 
						|
                <a href="../../sys_accounts/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    System Accounts
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.6.4.1" data-path="../../sys_accounts/sys_accounts.html">
 | 
						|
            
 | 
						|
                <a href="../../sys_accounts/sys_accounts.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuration
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.7" data-path="../../nats_docker/">
 | 
						|
            
 | 
						|
                <a href="../../nats_docker/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    NATS and Docker
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.7.1" data-path="../../nats_docker/nats-docker-tutorial.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_docker/nats-docker-tutorial.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Tutorial
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="4.7.2" data-path="../../nats_docker/docker_swarm.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_docker/docker_swarm.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Docker Swarm
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">NATS Tools</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.1" data-path="../mkpasswd.html">
 | 
						|
            
 | 
						|
                <a href="../mkpasswd.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    mkpasswd
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.2" data-path="../nk.html">
 | 
						|
            
 | 
						|
                <a href="../nk.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    nk
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.3" data-path="./">
 | 
						|
            
 | 
						|
                <a href="./">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    nsc
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter active" data-level="5.3.1" data-path="nsc.html">
 | 
						|
            
 | 
						|
                <a href="nsc.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Basics
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.3.2" data-path="streams.html">
 | 
						|
            
 | 
						|
                <a href="streams.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Streams
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.3.3" data-path="services.html">
 | 
						|
            
 | 
						|
                <a href="services.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Services
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.3.4" data-path="signing_keys.html">
 | 
						|
            
 | 
						|
                <a href="signing_keys.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Signing Keys
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.3.5" data-path="revocation.html">
 | 
						|
            
 | 
						|
                <a href="revocation.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Revocation
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.3.6" data-path="managed.html">
 | 
						|
            
 | 
						|
                <a href="managed.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Managed Operators
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.4" data-path="../nas/">
 | 
						|
            
 | 
						|
                <a href="../nas/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    nats-account-server
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.4.1" data-path="../nas/nas_conf.html">
 | 
						|
            
 | 
						|
                <a href="../nas/nas_conf.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Basics
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.4.2" data-path="../nas/inspecting_jwts.html">
 | 
						|
            
 | 
						|
                <a href="../nas/inspecting_jwts.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Inspecting JWTs
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.4.3" data-path="../nas/dir_store.html">
 | 
						|
            
 | 
						|
                <a href="../nas/dir_store.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Directory Store
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.4.4" data-path="../nas/notifications.html">
 | 
						|
            
 | 
						|
                <a href="../nas/notifications.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Update Notifications
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.4.5" data-path="../nas/mem_resolver.html">
 | 
						|
            
 | 
						|
                <a href="../nas/mem_resolver.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Memory Resolver
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.5" data-path="../nats_top/">
 | 
						|
            
 | 
						|
                <a href="../nats_top/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    nats-top
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.5.1" data-path="../nats_top/nats-top-tutorial.html">
 | 
						|
            
 | 
						|
                <a href="../nats_top/nats-top-tutorial.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Tutorial
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="5.6" data-path="../natsbench.html">
 | 
						|
            
 | 
						|
                <a href="../natsbench.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    nats-bench
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">NATS Streaming Concepts</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.1" data-path="../../nats_streaming/intro.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/intro.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Introduction
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.2" data-path="../../nats_streaming/relation-to-nats.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/relation-to-nats.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Relation to NATS
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.3" data-path="../../nats_streaming/client-connections.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/client-connections.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Client Connections
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.4" data-path="../../nats_streaming/channels/channels.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/channels/channels.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Channels
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.4.1" data-path="../../nats_streaming/channels/message-log.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/channels/message-log.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Message Log
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.4.2" data-path="../../nats_streaming/channels/subscriptions/subscriptions.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/channels/subscriptions/subscriptions.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Subscriptions
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.4.2.1" data-path="../../nats_streaming/channels/subscriptions/regular.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/channels/subscriptions/regular.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Regular
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.4.2.2" data-path="../../nats_streaming/channels/subscriptions/durable.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/channels/subscriptions/durable.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Durable
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.4.2.3" data-path="../../nats_streaming/channels/subscriptions/queue-group.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/channels/subscriptions/queue-group.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Queue Group
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.4.2.4" data-path="../../nats_streaming/channels/subscriptions/redelivery.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/channels/subscriptions/redelivery.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Redelivery
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.5" data-path="../../nats_streaming/store-interface.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/store-interface.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Store Interface
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.6" data-path="../../nats_streaming/store-encryption.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/store-encryption.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Store Encryption
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.7" data-path="../../nats_streaming/clustering/clustering.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/clustering/clustering.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Clustering
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.7.1" data-path="../../nats_streaming/clustering/supported-stores.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/clustering/supported-stores.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Supported Stores
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.7.2" data-path="../../nats_streaming/clustering/configuration.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/clustering/configuration.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuration
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.7.3" data-path="../../nats_streaming/clustering/auto-configuration.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/clustering/auto-configuration.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Auto Configuration
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.7.4" data-path="../../nats_streaming/clustering/containers.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/clustering/containers.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Containers
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.8" data-path="../../nats_streaming/fault-tolerance/ft.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/fault-tolerance/ft.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Fault Tolerance
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.8.1" data-path="../../nats_streaming/fault-tolerance/active-server.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/fault-tolerance/active-server.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Active Server
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.8.2" data-path="../../nats_streaming/fault-tolerance/standby-server.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/fault-tolerance/standby-server.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Standby Servers
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.8.3" data-path="../../nats_streaming/fault-tolerance/shared-state.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/fault-tolerance/shared-state.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Shared State
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.8.4" data-path="../../nats_streaming/fault-tolerance/failover.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/fault-tolerance/failover.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Failover
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.9" data-path="../../nats_streaming/partitioning.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/partitioning.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Partitioning
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.10" data-path="../../nats_streaming/monitoring/monitoring.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/monitoring/monitoring.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Monitoring
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="6.10.1" data-path="../../nats_streaming/monitoring/endpoints.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/monitoring/endpoints.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Endpoints
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">Developing With NATS Streaming</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.1" data-path="../../developer/streaming/">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Introduction
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.2" data-path="../../developer/streaming/connecting.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/connecting.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Connecting to NATS Streaming
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.3" data-path="../../developer/streaming/publishing.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/publishing.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Publishing to a Channel
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.4" data-path="../../developer/streaming/receiving.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/receiving.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Receiving Messages from a Channel
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.5" data-path="../../developer/streaming/durables.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/durables.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Durable Subscriptions
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.6" data-path="../../developer/streaming/queues.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/queues.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Queue Subscriptions
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.7" data-path="../../developer/streaming/acks.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/acks.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Acknowledgements
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="7.8" data-path="../../developer/streaming/protocol.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/protocol.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    The Streaming Protocol
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">NATS Streaming Server</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.1" data-path="../../nats_streaming/gettingstarted/changes.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/gettingstarted/changes.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Important Changes
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.2" data-path="../../nats_streaming/gettingstarted/install.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/gettingstarted/install.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Installing
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.3" data-path="../../nats_streaming/gettingstarted/run.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/gettingstarted/run.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Running
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4" data-path="../../nats_streaming/configuring/configuring.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/configuring.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuring
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.1" data-path="../../nats_streaming/configuring/cmdline.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/cmdline.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Command line arguments
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.2" data-path="../../nats_streaming/configuring/cfgfile.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/cfgfile.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Configuration file
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.3" data-path="../../nats_streaming/configuring/storelimits.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/storelimits.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Store Limits
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.3.1" data-path="../../nats_streaming/configuring/storelimits.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/storelimits.html#limits-inheritance">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Limits inheritance
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.4" data-path="../../nats_streaming/configuring/persistence.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/persistence.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Persistence
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.4.1" data-path="../../nats_streaming/configuring/filestore.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/filestore.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    File Store
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.4.1.1" data-path="../../nats_streaming/configuring/filestore.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/filestore.html#options">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Options
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.4.1.2" data-path="../../nats_streaming/configuring/filestore.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/filestore.html#recovery-errors">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Recovery Errors
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.4.2" data-path="../../nats_streaming/configuring/sqlstore.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/sqlstore.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    SQL Store
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.4.2.1" data-path="../../nats_streaming/configuring/sqlstore.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/sqlstore.html#read-and-write-timeouts">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Read and Write Timeouts
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.4.2.2" data-path="../../nats_streaming/configuring/sqlstore.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/sqlstore.html#options">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Options
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.5" data-path="../../nats_streaming/configuring/tls.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/tls.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Securing
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.5.1" data-path="../../nats_streaming/configuring/tls.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/tls.html#authenticating-users">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Authenticating Users
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.4.5.2" data-path="../../nats_streaming/configuring/tls.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/configuring/tls.html#using-tls">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    TLS
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.5" data-path="../../nats_streaming/gettingstarted/process-signaling.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/gettingstarted/process-signaling.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Process Signaling
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.6" data-path="../../nats_streaming/gettingstarted/windows-service.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/gettingstarted/windows-service.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Windows Service
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.7" data-path="../../developer/streaming/embedding.html">
 | 
						|
            
 | 
						|
                <a href="../../developer/streaming/embedding.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Embedding NATS Streaming Server
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="8.8" data-path="../../nats_streaming/swarm.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_streaming/swarm.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Docker Swarm
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
        
 | 
						|
        <li class="header">NATS Protocol</li>
 | 
						|
        
 | 
						|
        
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="9.1" data-path="../../nats_protocol/nats-protocol-demo.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_protocol/nats-protocol-demo.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Protocol Demo
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="9.2" data-path="../../nats_protocol/nats-protocol.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_protocol/nats-protocol.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Client Protocol
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
            <ul class="articles">
 | 
						|
                
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="9.2.1" data-path="../../nats_protocol/nats-client-dev.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_protocol/nats-client-dev.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    Developing a Client
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
            </ul>
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
        <li class="chapter " data-level="9.3" data-path="../../nats_protocol/nats-server-protocol.html">
 | 
						|
            
 | 
						|
                <a href="../../nats_protocol/nats-server-protocol.html">
 | 
						|
            
 | 
						|
                    
 | 
						|
                    NATS Cluster Protocol
 | 
						|
            
 | 
						|
                </a>
 | 
						|
            
 | 
						|
 | 
						|
            
 | 
						|
        </li>
 | 
						|
    
 | 
						|
 | 
						|
    
 | 
						|
 | 
						|
    <li class="divider"></li>
 | 
						|
 | 
						|
    <li>
 | 
						|
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
 | 
						|
            Published with GitBook
 | 
						|
        </a>
 | 
						|
    </li>
 | 
						|
</ul>
 | 
						|
 | 
						|
 | 
						|
                </nav>
 | 
						|
            
 | 
						|
        
 | 
						|
    </div>
 | 
						|
 | 
						|
    <div class="book-body">
 | 
						|
        
 | 
						|
            <div class="body-inner">
 | 
						|
                
 | 
						|
                    
 | 
						|
 | 
						|
<div class="book-header" role="navigation">
 | 
						|
    
 | 
						|
 | 
						|
    <!-- Title -->
 | 
						|
    <h1>
 | 
						|
        <i class="fa fa-circle-o-notch fa-spin"></i>
 | 
						|
        <a href="../.." >Basics</a>
 | 
						|
    </h1>
 | 
						|
</div>
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
                    <div class="page-wrapper" tabindex="-1" role="main">
 | 
						|
                        <div class="page-inner">
 | 
						|
                            
 | 
						|
<div id="book-search-results">
 | 
						|
    <div class="search-noresults">
 | 
						|
    
 | 
						|
                                <section class="normal markdown-section">
 | 
						|
                                
 | 
						|
                                <h1 id="nsc"><a name="nsc" class="plugin-anchor" href="#nsc"><i class="fa fa-link" aria-hidden="true"></i></a>NSC</h1>
 | 
						|
<p>NATS uses JWTs to armor the various identity and authorization artifacts. These JWTs are created with the <code>nsc</code> tool. NSC simplifies the tasks of creating and managing identities and other JWT artifacts.</p>
 | 
						|
<p>There’s a logical hierarchy to the entities:</p>
 | 
						|
<ul>
 | 
						|
<li><p><code>Operators</code> are responsible for running nats-servers, and signing account JWTs that set the limits on what an account can do, such as the number of connections, data limits, etc.</p>
 | 
						|
</li>
 | 
						|
<li><p><code>Accounts</code> are responsible for issuing user JWTs, and for declaring what subjects can be exported to other accounts, and what subjects they import from other accounts and what the local subjects for those imports are.</p>
 | 
						|
</li>
 | 
						|
<li><p><code>Users</code> are issued by an account, and encode limits regarding usage and authorization over the subject space.</p>
 | 
						|
</li>
 | 
						|
</ul>
 | 
						|
<p>NSC allows you to create, edit, delete these entities, and will be central to all account based configuration.</p>
 | 
						|
<p>In this guide, you’ll run end-to-end on some of the configuration scenarios:</p>
 | 
						|
<ul>
 | 
						|
<li>generate JWTs</li>
 | 
						|
<li>make JWTs accessible to a nats-server</li>
 | 
						|
<li>configure a nats-server to use JWTs</li>
 | 
						|
</ul>
 | 
						|
<p>Let’s run through the process of creating some identities and JWTs and work through the process.</p>
 | 
						|
<h2 id="the-nsc-environment"><a name="the-nsc-environment" class="plugin-anchor" href="#the-nsc-environment"><i class="fa fa-link" aria-hidden="true"></i></a>The NSC Environment</h2>
 | 
						|
<p>By default JWTs are written to ~/.nsc and secrets to ~/.nkeys. nsc also tracks a value called the "stores directory". This directory contains the operators you are currently working with. By default the stores directory is ~/.nsc/nats but you can switch it to another folder if you want to separate JWTs for use in a revision control system, or co-locate them with a project, etc..</p>
 | 
						|
<p>To see the current NSC environment use the command <code>nsc env</code>:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc env
 | 
						|
╭──────────────────────────────────────────╮
 | 
						|
│             NSC Environment              │
 | 
						|
├──────────────────┬─────┬─────────────────┤
 | 
						|
│ Setting          │ Set │ Effective Value │
 | 
						|
├──────────────────┼─────┼─────────────────┤
 | 
						|
│ $NKEYS_PATH      │ No  │ ~/.nkeys        │
 | 
						|
│ $NSC_HOME        │ No  │ ~/.nsc          │
 | 
						|
│ Config           │     │ ~/.nsc/nsc.json │
 | 
						|
├──────────────────┼─────┼─────────────────┤
 | 
						|
│ Stores Dir       │     │ ~/.nsc/nats     │
 | 
						|
│ Default Operator │     │                 │
 | 
						|
│ Default Account  │     │                 │
 | 
						|
│ Default Cluster  │     │                 │
 | 
						|
╰──────────────────┴─────┴─────────────────╯
 | 
						|
</code></pre>
 | 
						|
<p>As you can see there is a setting for the nkeys folder and the nsc home. By default you’ll see that generated secrets are stored in <code>~/.nkeys</code>, and configurations in <code>~/.nsc/nats</code>. All operations are assumed to be in a context of the current operator and current account. When working with multiple operators and accounts you may need to set the current one. You can easily do so by issuing the <code>nsc env</code> and provide flags to set the current operator or account. See <code>nsc env —help</code> for more details.</p>
 | 
						|
<p>You can easily change the home and keys locations by setting <code>NSC_HOME</code> and <code>NKEYS_PATH</code> respectively in your environment to your desired locations. The environment itself is stored in the <code>NSC_HOME</code>. Operator folders are in the stores directory which can be inside <code>NSC_HOME</code> or external to it.</p>
 | 
						|
<blockquote>
 | 
						|
<p>The $NKEYS_PATH stores secrets. Since nkeys relies on cryptographic signatures to prove identity, anyone with access to your private keys will be able to assume your identity. With that said, treat them as secrets and guard them carefully.</p>
 | 
						|
</blockquote>
 | 
						|
<h2 id="creating-an-operator"><a name="creating-an-operator" class="plugin-anchor" href="#creating-an-operator"><i class="fa fa-link" aria-hidden="true"></i></a>Creating an Operator</h2>
 | 
						|
<p>Let’s create an operator called <code>Test</code>:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc add operator -n Test
 | 
						|
Generated operator key - private key stored “~/.nkeys/Test/Test.nk”
 | 
						|
Success! - added operator "Test"
 | 
						|
</code></pre>
 | 
						|
<p>With the above incantation, the tool generated an NKEY for the operator, stored the private key safely in <code>~/.nkeys/Test/Test.nk</code>. The file contains a single line, with the seed value for the NKEY.</p>
 | 
						|
<blockquote>
 | 
						|
<p>You can tell the key is a seed if it starts with the letter <code>S</code>. The type of the key is will be the second letter an <code>O</code>, <code>A</code> or <code>U</code> for <em>Operator</em>, <em>Account</em> or <em>User</em>. If the key does not start with an <code>S</code> you have instead a public key.</p>
 | 
						|
</blockquote>
 | 
						|
<p>The tool also created a JWT with all default settings for the operator test, and stored it in <code>~/.nsc/nats/Test/Test.jwt</code>. The <code>~/.nsc/nats/Test</code> directory will also contain a directory where accounts related to this operator will live.</p>
 | 
						|
<p>You can view the JWT by entering the command:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc describe operator
 | 
						|
╭───────────────────────────────────────╮
 | 
						|
│           Operator Details            │
 | 
						|
├─────────────┬─────────────────────────┤
 | 
						|
│ Name        │ Test                    │
 | 
						|
│ Operator ID │ OCEWHXFL3I5I            │
 | 
						|
│ Issuer ID   │ OCEWHXFL3I5I            │
 | 
						|
│ Issued      │ 2019-06-11 16:25:37 UTC │
 | 
						|
│ Expires     │                         │
 | 
						|
╰─────────────┴─────────────────────────╯
 | 
						|
</code></pre>
 | 
						|
<p>Note that the Operator ID is truncated to simplify the output, to get the full ID, do:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc describe operator -W
 | 
						|
╭────────────────────────────────────────────────────────────────────────╮
 | 
						|
│                            Operator Details                            │
 | 
						|
├─────────────┬──────────────────────────────────────────────────────────┤
 | 
						|
│ Name        │ Test                                                     │
 | 
						|
│ Operator ID │ OCEWHXFL3I5IWPFK2674IUQTFHRZXHI52S2DKQIQJXRXC6P6GWSINZ3H │
 | 
						|
│ Issuer ID   │ OCEWHXFL3I5IWPFK2674IUQTFHRZXHI52S2DKQIQJXRXC6P6GWSINZ3H │
 | 
						|
│ Issued      │ 2019-06-11 16:25:37 UTC                                  │
 | 
						|
│ Expires     │                                                          │
 | 
						|
╰─────────────┴──────────────────────────────────────────────────────────╯
 | 
						|
</code></pre>
 | 
						|
<p>The operator JWT contains two important URLs. The <code>account-jwt-server-url</code> is used by <code>nsc</code> when you want to push JWTs to an account server. The <code>service-url</code>s are used by <code>nsc</code> when you run the tool commands, like <code>nsc tool pub</code>.</p>
 | 
						|
<p>With an operator, we are ready to create our first account.</p>
 | 
						|
<h2 id="creating-an-account"><a name="creating-an-account" class="plugin-anchor" href="#creating-an-account"><i class="fa fa-link" aria-hidden="true"></i></a>Creating an Account</h2>
 | 
						|
<p>Let’s create an account called <code>TestAccount</code>:</p>
 | 
						|
<pre class="language-"><code>> nsc add account -n TestAccount
 | 
						|
Generated account key - private key stored “~/.nkeys/Test/accounts/TestAccount/TestAccount.nk"
 | 
						|
Success! - added account "TestAccount"
 | 
						|
</code></pre><p>As we did with the operator, we can describe the account:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc describe account 
 | 
						|
╭─────────────────────────────────────────────────────╮
 | 
						|
│                   Account Details                   │
 | 
						|
├───────────────────────────┬─────────────────────────┤
 | 
						|
│ Name                      │ TestAccount             │
 | 
						|
│ Account ID                │ ADM7UGD4FV52            │
 | 
						|
│ Issuer ID                 │ OCEWHXFL3I5I            │
 | 
						|
│ Issued                    │ 2019-06-11 16:25:57 UTC │
 | 
						|
│ Expires                   │                         │
 | 
						|
├───────────────────────────┼─────────────────────────┤
 | 
						|
│ Max Connections           │ Unlimited               │
 | 
						|
│ Max Leaf Node Connections │ Unlimited               │
 | 
						|
│ Max Data                  │ Unlimited               │
 | 
						|
│ Max Exports               │ Unlimited               │
 | 
						|
│ Max Imports               │ Unlimited               │
 | 
						|
│ Max Msg Payload           │ Unlimited               │
 | 
						|
│ Max Subscriptions         │ Unlimited               │
 | 
						|
│ Exports Allows Wildcards  │ True                    │
 | 
						|
├───────────────────────────┼─────────────────────────┤
 | 
						|
│ Imports                   │ None                    │
 | 
						|
│ Exports                   │ None                    │
 | 
						|
╰───────────────────────────┴─────────────────────────╯
 | 
						|
</code></pre>
 | 
						|
<p>Again, specifying the <code>-W</code> flag will print the complete account ID (the public key identifying the account).</p>
 | 
						|
<p>Note that the issuer for the account is the ID for the operator (the public key identifying the operator).</p>
 | 
						|
<p>Now we are ready to add a user.</p>
 | 
						|
<h2 id="creating-a-user"><a name="creating-a-user" class="plugin-anchor" href="#creating-a-user"><i class="fa fa-link" aria-hidden="true"></i></a>Creating a User</h2>
 | 
						|
<p>Let’s add a user named ‘TestUser’:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc add user -n TestUser
 | 
						|
Generated user key - private key stored "~/.nkeys/Test/accounts/TestAccount/users/TestUser.nk"
 | 
						|
Generated user creds file "~/.nkeys/Test/accounts/TestAccount/users/TestUser.creds"
 | 
						|
Success! - added user "TestUser" to "TestAccount"
 | 
						|
</code></pre>
 | 
						|
<p>Note that when we added the user, we got a message telling us about a <code>.creds</code> file being created. The <code>.creds</code> file contains the JWT describing the user, and the private  (seed) key for the user. This file is formatted in a special way for use by nats client libraries. Client libraries can extract the JWT and seed key, and connect to a server expecting JWT authentication, provide the JWT and use the private key to sign the nonce to verify its identity.</p>
 | 
						|
<p>And let’s describe it:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc describe user
 | 
						|
╭───────────────────────────────────────────╮
 | 
						|
│                   User                    │
 | 
						|
├─────────────────┬─────────────────────────┤
 | 
						|
│ Name            │ TestUser                │
 | 
						|
│ User ID         │ UBV36EUP2B3Q            │
 | 
						|
│ Issuer ID       │ ADM7UGD4FV52            │
 | 
						|
│ Issued          │ 2019-06-11 16:26:22 UTC │
 | 
						|
│ Expires         │                         │
 | 
						|
├─────────────────┼─────────────────────────┤
 | 
						|
│ Max Messages    │ Unlimited               │
 | 
						|
│ Max Msg Payload │ Unlimited               │
 | 
						|
│ Network Src     │ Any                     │
 | 
						|
│ Time            │ Any                     │
 | 
						|
╰─────────────────┴─────────────────────────╯
 | 
						|
</code></pre>
 | 
						|
<p>Let’s put all of this together, and create a simple server configuration that accepts sessions from TestUser.</p>
 | 
						|
<h2 id="account-server-configuration"><a name="account-server-configuration" class="plugin-anchor" href="#account-server-configuration"><i class="fa fa-link" aria-hidden="true"></i></a>Account Server Configuration</h2>
 | 
						|
<p>To configure a server to use accounts you need an <em>account resolver</em>. An account resolver exposes a URL where a nats-server can query for JWTs belonging to an account.</p>
 | 
						|
<p>A simple built-in resolver is the <code>MEMORY</code> resolver which simply statically maps account public keys to an account JWT in the server’s configuration file. It is somewhat easier to configure because it doesn’t require another moving part, but fails provide the needed experience of setting up an account server. Let’s setup an <em>Account Server</em>.</p>
 | 
						|
<p>Installing the Account Server</p>
 | 
						|
<pre class="language-"><code class="lang-text">> go get github.com/nats-io/nats-account-server
 | 
						|
</code></pre>
 | 
						|
<p>The account server has options to enable you to use an nsc directory directly. Let’s start one:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nats-account-server -nsc ~/.nsc/nats/Test
 | 
						|
</code></pre>
 | 
						|
<p>Above we pointed the account server to our nsc data directory (more specifically to the <code>Test</code> operator that we created earlier). By default, the server listens on the localhost at port 9090.</p>
 | 
						|
<p>You can also run the account server with a data directory that is not your nsc folder. In this mode you can upload account JWTs to the server. See the help for <code>nsc push</code> for more information about how to push JWTs to the account server.</p>
 | 
						|
<p>We are now ready to configure the nats-server.</p>
 | 
						|
<h2 id="nats-server-configuration"><a name="nats-server-configuration" class="plugin-anchor" href="#nats-server-configuration"><i class="fa fa-link" aria-hidden="true"></i></a>NATS Server Configuration</h2>
 | 
						|
<p>If you don’t have a nats-server installed, let’s do that now:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> go get github.com/nats-io/nats-server
 | 
						|
</code></pre>
 | 
						|
<p>Let’s create a configuration that references our operator JWT and the nats-account-server as a resolver:</p>
 | 
						|
<pre class="language-"><code class="lang-yaml"><span class="token key atrule">operator</span><span class="token punctuation">:</span> /Users/synadia/.nsc/nats/Test/Test.jwt
 | 
						|
<span class="token key atrule">resolver</span><span class="token punctuation">:</span> URL(http<span class="token punctuation">:</span>//localhost<span class="token punctuation">:</span>9090/jwt/v1/accounts/)
 | 
						|
</code></pre>
 | 
						|
<p>At minimum the server requires the <code>operator</code> JWT, which we have pointed at directly, and a resolver. The resolver has two types <code>MEM</code> and <code>URL</code>. We are interested in the <code>URL</code> since we want the nats-server to talk to the account server. Note we put the URL of the server with the path <code>/jwt/v1/accounts</code>. Currently this is where the account server expects requests for account information.</p>
 | 
						|
<h2 id="client-testing"><a name="client-testing" class="plugin-anchor" href="#client-testing"><i class="fa fa-link" aria-hidden="true"></i></a>Client Testing</h2>
 | 
						|
<p>Let’s install some tooling:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> go get github.com/nats-io/nats.go/examples/nats-pub
 | 
						|
 | 
						|
> go get github.com/nats-io/nats.go/examples/nats-sub
 | 
						|
</code></pre>
 | 
						|
<p>Create a subscriber:</p>
 | 
						|
<pre class="language-"><code class="lang-text">nats-sub -creds ~/.nkeys/Test/accounts/TestAccount/users/TestUser.creds ">"
 | 
						|
Listening on [>]
 | 
						|
</code></pre>
 | 
						|
<p>Publish a message:</p>
 | 
						|
<pre class="language-"><code class="lang-text">nats-pub -creds ~/.nkeys/Test/accounts/TestAccount/users/TestUser.creds hello NATS 
 | 
						|
Published [hello] : 'NATS'
 | 
						|
</code></pre>
 | 
						|
<p>Subscriber shows:</p>
 | 
						|
<pre class="language-"><code class="lang-text">[#1] Received on [hello]: ’NATS’
 | 
						|
</code></pre>
 | 
						|
<h2 id="user-authorization"><a name="user-authorization" class="plugin-anchor" href="#user-authorization"><i class="fa fa-link" aria-hidden="true"></i></a>User Authorization</h2>
 | 
						|
<p>User authorization, as expected, also works with JWT authentication. With <code>nsc</code> you can specify authorization for specific subjects to which the user can or cannot publish or subscribe. By default a user doesn't have any limits on the subjects that it can publish or subscribe to. Any message stream or message published in the account is subscribable by the user. The user can also publish to any subject or imported service. Note that authorization, if configured, must be specified on a per user basis.</p>
 | 
						|
<p>When specifying limits it is important to remember that clients by default use generated "inboxes" to allow publish requests. When specifying subscribe and publish permissions, you need to enable clients to subscribe and publish to <code>_INBOX.></code>. You can further restrict it, but you'll be responsible for segmenting the subject space so as to not break request/reply communications between clients.</p>
 | 
						|
<p>Let's say you have a service that your account clients can make requests to under <code>req.a</code>. To enable the service to receive and respond to requests it requires permissions to subscribe to <code>req.a</code> and publish permissions under <code>_INBOX.></code>:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc add user --name TestService --allow-pub "_INBOX.>" --allow-sub "req.a"
 | 
						|
Generated user key - private key stored "~/.nkeys/Test/accounts/TestAccount/users/TestService.nk"
 | 
						|
Generated user creds file "~/.nkeys/Test/accounts/TestAccount/users/TestService.creds"
 | 
						|
Success! - added user "TestService" to "TestAccount"
 | 
						|
 | 
						|
> nsc describe user --name TestService
 | 
						|
╭───────────────────────────────────────────╮
 | 
						|
│                   User                    │
 | 
						|
├─────────────────┬─────────────────────────┤
 | 
						|
│ Name            │ TestService             │
 | 
						|
│ User ID         │ UCAYGJXTF5WO            │
 | 
						|
│ Issuer ID       │ ADM7UGD4FV52            │
 | 
						|
│ Issued          │ 2019-06-11 16:41:03 UTC │
 | 
						|
│ Expires         │                         │
 | 
						|
├─────────────────┼─────────────────────────┤
 | 
						|
│ Pub Allow       │ _INBOX.>                │
 | 
						|
│ Sub Allow       │ req.a                   │
 | 
						|
├─────────────────┼─────────────────────────┤
 | 
						|
│ Max Messages    │ Unlimited               │
 | 
						|
│ Max Msg Payload │ Unlimited               │
 | 
						|
│ Network Src     │ Any                     │
 | 
						|
│ Time            │ Any                     │
 | 
						|
╰─────────────────┴─────────────────────────╯
 | 
						|
</code></pre>
 | 
						|
<p>As you can see this client is not limited to publishing responses to <code>_INBOX.></code> addresses, and to subscribing to the service's request subject.</p>
 | 
						|
<p>Similarly, we can limit a client:</p>
 | 
						|
<pre class="language-"><code class="lang-text">> nsc add user --name TestClient --allow-pub "req.a" --allow-sub "_INBOX.>"
 | 
						|
Generated user key - private key stored "~/.nkeys/Test/accounts/TestAccount/users/TestClient.nk"
 | 
						|
Generated user creds file "~/.nkeys/Test/accounts/TestAccount/users/TestClient.creds"
 | 
						|
Success! - added user "TestClient" to "TestAccount"
 | 
						|
 | 
						|
> nsc describe user --name TestClient
 | 
						|
╭───────────────────────────────────────────╮
 | 
						|
│                   User                    │
 | 
						|
├─────────────────┬─────────────────────────┤
 | 
						|
│ Name            │ TestClient              │
 | 
						|
│ User ID         │ UDJ3LCVNTYXL            │
 | 
						|
│ Issuer ID       │ ADM7UGD4FV52            │
 | 
						|
│ Issued          │ 2019-06-11 16:43:46 UTC │
 | 
						|
│ Expires         │                         │
 | 
						|
├─────────────────┼─────────────────────────┤
 | 
						|
│ Pub Allow       │ req.a                   │
 | 
						|
│ Sub Allow       │ _INBOX.>                │
 | 
						|
├─────────────────┼─────────────────────────┤
 | 
						|
│ Max Messages    │ Unlimited               │
 | 
						|
│ Max Msg Payload │ Unlimited               │
 | 
						|
│ Network Src     │ Any                     │
 | 
						|
│ Time            │ Any                     │
 | 
						|
╰─────────────────┴─────────────────────────╯
 | 
						|
</code></pre>
 | 
						|
<p>The client has the opposite permissions of the service. It can publish on the request subject <code>req.a</code>, and receive replies on an inbox.</p>
 | 
						|
 | 
						|
                                
 | 
						|
                                </section>
 | 
						|
                            
 | 
						|
    </div>
 | 
						|
    <div class="search-results">
 | 
						|
        <div class="has-results">
 | 
						|
            
 | 
						|
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
 | 
						|
            <ul class="search-results-list"></ul>
 | 
						|
            
 | 
						|
        </div>
 | 
						|
        <div class="no-results">
 | 
						|
            
 | 
						|
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
 | 
						|
            
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
</div>
 | 
						|
 | 
						|
                        </div>
 | 
						|
                    </div>
 | 
						|
                
 | 
						|
            </div>
 | 
						|
 | 
						|
            
 | 
						|
                
 | 
						|
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: nsc">
 | 
						|
                    <i class="fa fa-angle-left"></i>
 | 
						|
                </a>
 | 
						|
                
 | 
						|
                
 | 
						|
                <a href="streams.html" class="navigation navigation-next " aria-label="Next page: Streams">
 | 
						|
                    <i class="fa fa-angle-right"></i>
 | 
						|
                </a>
 | 
						|
                
 | 
						|
            
 | 
						|
        
 | 
						|
    </div>
 | 
						|
 | 
						|
    <script>
 | 
						|
        var gitbook = gitbook || [];
 | 
						|
        gitbook.push(function() {
 | 
						|
            gitbook.page.hasChanged({"page":{"title":"Basics","level":"5.3.1","depth":2,"next":{"title":"Streams","level":"5.3.2","depth":2,"path":"nats_tools/nsc/streams.md","ref":"nats_tools/nsc/streams.md","articles":[]},"previous":{"title":"nsc","level":"5.3","depth":1,"path":"nats_tools/nsc/README.md","ref":"nats_tools/nsc/README.md","articles":[{"title":"Basics","level":"5.3.1","depth":2,"path":"nats_tools/nsc/nsc.md","ref":"nats_tools/nsc/nsc.md","articles":[]},{"title":"Streams","level":"5.3.2","depth":2,"path":"nats_tools/nsc/streams.md","ref":"nats_tools/nsc/streams.md","articles":[]},{"title":"Services","level":"5.3.3","depth":2,"path":"nats_tools/nsc/services.md","ref":"nats_tools/nsc/services.md","articles":[]},{"title":"Signing Keys","level":"5.3.4","depth":2,"path":"nats_tools/nsc/signing_keys.md","ref":"nats_tools/nsc/signing_keys.md","articles":[]},{"title":"Revocation","level":"5.3.5","depth":2,"path":"nats_tools/nsc/revocation.md","ref":"nats_tools/nsc/revocation.md","articles":[]},{"title":"Managed Operators","level":"5.3.6","depth":2,"path":"nats_tools/nsc/managed.md","ref":"nats_tools/nsc/managed.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["prism","-sharing","-highlight","include-html","toggle-chapters","anchors","edit-link"],"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"}},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"include-html":{},"fontsettings":{"theme":"white","family":"sans","size":2},"edit-link":{"label":"edit","base":"https://github.com/nats-io/docs/edit/master"},"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},"anchors":{},"toggle-chapters":{}},"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_tools/nsc/nsc.md","mtime":"2019-09-23T22:49:18.495Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-27T21:13:11.925Z"},"basePath":"../..","book":{"language":""}});
 | 
						|
        });
 | 
						|
    </script>
 | 
						|
</div>
 | 
						|
 | 
						|
<!-- Viz Support -->
 | 
						|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/2.1.2/viz.js"> </script>
 | 
						|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/2.1.2/lite.render.js"> </script>
 | 
						|
 | 
						|
<!-- Site code -->
 | 
						|
<script>
 | 
						|
    function flash(elem, text, speed) {
 | 
						|
        if (!elem) {
 | 
						|
            return;
 | 
						|
        }
 | 
						|
        var s = elem.style;
 | 
						|
        elem.textContent = text;
 | 
						|
        s.display = 'block';
 | 
						|
        s.opacity = 1;
 | 
						|
        (function fade() {
 | 
						|
            (s.opacity -= .1) < .1 ? s.display = "none" : setTimeout(fade, speed)
 | 
						|
        })();
 | 
						|
    }
 | 
						|
 | 
						|
    function copyToClipboard(text, el) {
 | 
						|
        var copyTest = document.queryCommandSupported('copy');
 | 
						|
        var elOriginalText = el.getAttribute('data-original-title');
 | 
						|
 | 
						|
        if (copyTest === true) {
 | 
						|
            var copyTextArea = document.createElement("textarea");
 | 
						|
            copyTextArea.value = text;
 | 
						|
            document.body.appendChild(copyTextArea);
 | 
						|
            copyTextArea.select();
 | 
						|
            try {
 | 
						|
                var successful = document.execCommand('copy');
 | 
						|
                var msg = successful ? 'Copied!' : 'Whoops, not copied!';
 | 
						|
                var parent = el.parentNode.parentNode;
 | 
						|
                var msgElem = parent.querySelector(".copy-msg");
 | 
						|
                flash(msgElem, msg, 100);
 | 
						|
            } catch (err) {
 | 
						|
                console.log('Oops, unable to copy', err);
 | 
						|
            }
 | 
						|
            document.body.removeChild(copyTextArea);
 | 
						|
            el.setAttribute('data-original-title', elOriginalText);
 | 
						|
        } else {
 | 
						|
            // Fallback if browser doesn't support .execCommand('copy')
 | 
						|
            window.prompt("Copy to clipboard: Ctrl+C or Command+C, Enter", text);
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    function processGraphVizSections(elements) {
 | 
						|
        var elements = document.querySelectorAll("[data-viz]");
 | 
						|
        var viz = new Viz();
 | 
						|
        Array.prototype.forEach.call(elements, function (x) {
 | 
						|
            var engine = x.getAttribute("data-viz");
 | 
						|
            var image = viz.renderImageElement(x.innerText, {
 | 
						|
                format: "png",
 | 
						|
                engine: engine
 | 
						|
            }).then(function (element) {
 | 
						|
                x.parentNode.insertBefore(element, x);
 | 
						|
            });
 | 
						|
        });
 | 
						|
 | 
						|
 | 
						|
    };
 | 
						|
 | 
						|
    function updateLanguageParameter(value) {
 | 
						|
        const param = "lang";
 | 
						|
 | 
						|
        if (window.location.href.indexOf("?") >= 0) {
 | 
						|
            const regExp = new RegExp(param + "(.+?)(&|$)", "g");
 | 
						|
            const newUrl = window.location.href.replace(regExp, param + "=" + encodeURIComponent(value) + "$2");
 | 
						|
            window.history.pushState("", "", newUrl);
 | 
						|
        } else {
 | 
						|
            const newUrl = window.location.href + "?" + param + "=" + encodeURIComponent(value);
 | 
						|
            window.history.pushState("", "", newUrl);
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    function getLanguageParameter() {
 | 
						|
        var match = RegExp('[?&]lang=([^&]*)').exec(window.location.search);
 | 
						|
        return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
 | 
						|
    }
 | 
						|
 | 
						|
    function docReady() {
 | 
						|
        window.gitbook.events.bind("page.change", function () {
 | 
						|
            pageChanged();
 | 
						|
        });
 | 
						|
 | 
						|
        var searchInput = document.querySelector('#book-search-input input');
 | 
						|
 | 
						|
        if (searchInput) {
 | 
						|
            searchInput.addEventListener('keyup', function(event) {
 | 
						|
                if (event.keyCode === 13) {
 | 
						|
                    event.target.blur();
 | 
						|
                }
 | 
						|
            });
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    function pageChanged() {
 | 
						|
        var logos = document.querySelectorAll(".nats");
 | 
						|
        if (logos && logos.length == 0) {
 | 
						|
            gitbook.toolbar.createButton({
 | 
						|
                icon: 'nats',
 | 
						|
                label: 'NATS Home Page',
 | 
						|
                position: 'right',
 | 
						|
                onClick: function () {
 | 
						|
                    var win = window.open("https://nats.io/", '_blank');
 | 
						|
                    win.focus();
 | 
						|
                }
 | 
						|
            });
 | 
						|
        }
 | 
						|
 | 
						|
        document.querySelectorAll('.js-copy').forEach(elem => {
 | 
						|
            elem.addEventListener("click", function () {
 | 
						|
                var el = this;
 | 
						|
                var parent = this.parentNode.parentNode;
 | 
						|
                var code = parent.querySelector('code');
 | 
						|
                var text = code.textContent || code.innerText;
 | 
						|
                copyToClipboard(text, el);
 | 
						|
            })
 | 
						|
        });
 | 
						|
 | 
						|
        document.querySelectorAll('.api-lang').forEach(elem => {
 | 
						|
            elem.addEventListener("click", function () {
 | 
						|
                var curLang = sessionStorage.getItem('nats-api-language');
 | 
						|
                var lang = this.getAttribute('data-language');
 | 
						|
 | 
						|
                // Stop the infinite loop
 | 
						|
                if (curLang == lang) {
 | 
						|
                    return;
 | 
						|
                }
 | 
						|
 | 
						|
                sessionStorage.setItem('nats-api-language', lang); // So we only do this 1x
 | 
						|
 | 
						|
                updateLanguageParameter(lang)
 | 
						|
 | 
						|
                document.querySelectorAll('.api-lang[data-language=' + lang + ']').forEach(elem => {
 | 
						|
                    elem.click();
 | 
						|
                });
 | 
						|
            })
 | 
						|
        });
 | 
						|
 | 
						|
        if (sessionStorage) {
 | 
						|
            var curLang = sessionStorage.getItem('nats-api-language');
 | 
						|
            var queryLang = getLanguageParameter();
 | 
						|
            var lang = curLang;
 | 
						|
 | 
						|
            if (queryLang) { // query takes precedent
 | 
						|
                lang = queryLang
 | 
						|
            }
 | 
						|
 | 
						|
            if (lang) {
 | 
						|
                document.querySelectorAll('.api-lang[data-language=' + lang + ']').forEach(elem => {
 | 
						|
                    elem.click();
 | 
						|
                });
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        setTimeout(function () {
 | 
						|
            processGraphVizSections();
 | 
						|
        }, 1);
 | 
						|
    }
 | 
						|
 | 
						|
 | 
						|
    if (document.readyState != 'loading') docReady();
 | 
						|
    else if (document.addEventListener) document.addEventListener('DOMContentLoaded', docReady);
 | 
						|
    else document.attachEvent('onreadystatechange', function () {
 | 
						|
        if (document.readyState == 'complete') docReady();
 | 
						|
    });
 | 
						|
</script>
 | 
						|
 | 
						|
<!-- Github Buttons -->
 | 
						|
<script async defer src="https://buttons.github.io/buttons.js"></script>
 | 
						|
 | 
						|
<!-- Styles -->
 | 
						|
<style>
 | 
						|
    .nats {
 | 
						|
        display: inline-block;
 | 
						|
        width: 16px;
 | 
						|
        height: 16px;
 | 
						|
        background: url(https://nats.io/img/nats-icon-color.svg);
 | 
						|
        background-size: 16px 16px;
 | 
						|
        background-repeat: no-repeat;
 | 
						|
    }
 | 
						|
 | 
						|
    div.graphviz {
 | 
						|
        background: transparent;
 | 
						|
        border: 0;
 | 
						|
        padding-top: 15px;
 | 
						|
        padding-right: 15px;
 | 
						|
        padding-bottom: 25px;
 | 
						|
        padding-left: 15px;
 | 
						|
        text-align: center;
 | 
						|
    }
 | 
						|
 | 
						|
    code[data-viz] {
 | 
						|
        display: none;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab-wrap {
 | 
						|
        transition: 0.3s box-shadow ease;
 | 
						|
        border-radius: 6px;
 | 
						|
        max-width: 100%;
 | 
						|
        display: flex;
 | 
						|
        flex-wrap: wrap;
 | 
						|
        position: relative;
 | 
						|
        list-style: none;
 | 
						|
        background-color: #fff;
 | 
						|
        margin: 20px 0;
 | 
						|
        /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);*/
 | 
						|
    }
 | 
						|
 | 
						|
    .tab-wrap:hover {
 | 
						|
        box-shadow: 0 12px 23px rgba(0, 0, 0, 0.23), 0 10px 10px rgba(0, 0, 0, 0.19);
 | 
						|
    }
 | 
						|
 | 
						|
    .tab {
 | 
						|
        display: none;
 | 
						|
    }
 | 
						|
 | 
						|
    /* Using scss these would be generated, we have to manually create enough for all tabs, start with 8 */
 | 
						|
    .tab:checked:nth-of-type(1)~.tab__content:nth-of-type(1) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked:nth-of-type(2)~.tab__content:nth-of-type(2) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked:nth-of-type(3)~.tab__content:nth-of-type(3) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked:nth-of-type(4)~.tab__content:nth-of-type(4) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked:nth-of-type(5)~.tab__content:nth-of-type(5) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked:nth-of-type(6)~.tab__content:nth-of-type(6) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked:nth-of-type(7)~.tab__content:nth-of-type(7) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked:nth-of-type(8)~.tab__content:nth-of-type(8) {
 | 
						|
        opacity: 1;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease;
 | 
						|
        transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
 | 
						|
        position: relative;
 | 
						|
        top: 0;
 | 
						|
        z-index: 100;
 | 
						|
        -webkit-transform: translateY(0px);
 | 
						|
        transform: translateY(0px);
 | 
						|
        text-shadow: 0 0 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:first-of-type:not(:last-of-type)+label {
 | 
						|
        border-top-right-radius: 0;
 | 
						|
        border-bottom-right-radius: 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:not(:first-of-type):not(:last-of-type)+label {
 | 
						|
        border-radius: 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:last-of-type:not(:first-of-type)+label {
 | 
						|
        border-top-left-radius: 0;
 | 
						|
        border-bottom-left-radius: 0;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked+label {
 | 
						|
        background-color: #fff;
 | 
						|
        box-shadow: 0 -1px 0 #fff inset;
 | 
						|
        cursor: default;
 | 
						|
        font-weight: bold;
 | 
						|
        border: 1px solid #ddd;
 | 
						|
        border-bottom-color: transparent;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab:checked+label:hover {
 | 
						|
        box-shadow: 0 -1px 0 #fff inset;
 | 
						|
        background-color: #fff;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab+label {
 | 
						|
        box-shadow: 0 -1px 0 #eee inset;
 | 
						|
        border-radius: 6px 6px 0 0;
 | 
						|
        cursor: pointer;
 | 
						|
        display: block;
 | 
						|
        text-decoration: none;
 | 
						|
        color: #27aae1;
 | 
						|
        flex-grow: 3;
 | 
						|
        text-align: center;
 | 
						|
        -webkit-user-select: none;
 | 
						|
        -moz-user-select: none;
 | 
						|
        -ms-user-select: none;
 | 
						|
        user-select: none;
 | 
						|
        text-align: center;
 | 
						|
        transition: 0.3s background-color ease, 0.3s box-shadow ease;
 | 
						|
        height: 50px;
 | 
						|
        box-sizing: border-box;
 | 
						|
        padding: 15px;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab+label:hover {
 | 
						|
        background-color: #f9f9f9;
 | 
						|
        box-shadow: 0 1px 0 #f4f4f4 inset;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab__content {
 | 
						|
        padding: 2px 2px;
 | 
						|
        background-color: transparent;
 | 
						|
        position: absolute;
 | 
						|
        width: 100%;
 | 
						|
        z-index: -1;
 | 
						|
        opacity: 0;
 | 
						|
        left: 0;
 | 
						|
        -webkit-transform: translateY(-3px);
 | 
						|
        transform: translateY(-3px);
 | 
						|
        border-radius: 6px;
 | 
						|
    }
 | 
						|
 | 
						|
    .tab__content pre {
 | 
						|
        margin-bottom: 0px !important;
 | 
						|
    }
 | 
						|
 | 
						|
    .toolbar-icons {
 | 
						|
        display: inline-block;
 | 
						|
        position: relative;
 | 
						|
        padding-left: 4px;
 | 
						|
    }
 | 
						|
 | 
						|
    a.toolbar-icons {
 | 
						|
        text-decoration: none;
 | 
						|
    }
 | 
						|
 | 
						|
    .toolbar-icons .mdi {
 | 
						|
        color: #4183c4;
 | 
						|
    }
 | 
						|
 | 
						|
    .copy-msg {
 | 
						|
        color: #4183c4;
 | 
						|
    }
 | 
						|
 | 
						|
    .pull-right {
 | 
						|
        float: right !important;
 | 
						|
    }
 | 
						|
 | 
						|
    .pull-left {
 | 
						|
        float: left !important;
 | 
						|
    }
 | 
						|
</style>
 | 
						|
<!-- Global site tag (gtag.js) - Google Analytics -->
 | 
						|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111730698-1"></script>
 | 
						|
<script>
 | 
						|
 window.dataLayer = window.dataLayer || [];
 | 
						|
 function gtag(){dataLayer.push(arguments);}
 | 
						|
 gtag('js', new Date());
 | 
						|
 | 
						|
 gtag('config', 'UA-111730698-1');
 | 
						|
</script>
 | 
						|
 | 
						|
        
 | 
						|
    <script src="../../gitbook/gitbook.js"></script>
 | 
						|
    <script src="../../gitbook/theme.js"></script>
 | 
						|
    
 | 
						|
        
 | 
						|
        <script src="../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
 | 
						|
        
 | 
						|
    
 | 
						|
        
 | 
						|
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
 | 
						|
        
 | 
						|
    
 | 
						|
 | 
						|
    </body>
 | 
						|
</html>
 | 
						|
 |