mirror of
https://github.com/hanzomsg/nats.js.git
synced 2026-10-30 20:31:36 +00:00
126 lines
59 KiB
HTML
126 lines
59 KiB
HTML
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WsConnectionOptions | @nats-io/nats-core</title><meta name="description" content="Documentation for @nats-io/nats-core"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@nats-io/nats-core</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">WsConnectionOptions</a></li></ul><h1>Interface WsConnectionOptions</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>WsConnectionOptions exposes wsconnect specific options not applicable to
|
||
other transports.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">WsConnectionOptions</span> <span class="tsd-signature-symbol">{</span><br/> <a class="tsd-kind-property" href="#authenticator">authenticator</a><span class="tsd-signature-symbol">?:</span> <a href="Authenticator.html" class="tsd-signature-type tsd-kind-interface">Authenticator</a> <span class="tsd-signature-symbol">|</span> <a href="Authenticator.html" class="tsd-signature-type tsd-kind-interface">Authenticator</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#debug">debug</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#ignoreautherrorabort">ignoreAuthErrorAbort</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#ignoreclusterupdates">ignoreClusterUpdates</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#inboxprefix">inboxPrefix</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#maxpingout">maxPingOut</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#maxreconnectattempts">maxReconnectAttempts</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#name">name</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#noasynctraces">noAsyncTraces</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#noecho">noEcho</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#norandomize">noRandomize</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#pass">pass</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#pedantic">pedantic</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#pinginterval">pingInterval</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#port">port</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#reconnect">reconnect</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#reconnectdelayhandler">reconnectDelayHandler</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#reconnectjitter">reconnectJitter</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#reconnectjittertls">reconnectJitterTLS</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#reconnecttimewait">reconnectTimeWait</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#resolve">resolve</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#servers">servers</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#timeout">timeout</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#tls">tls</a><span class="tsd-signature-symbol">?:</span> <a href="TlsOptions.html" class="tsd-signature-type tsd-kind-interface">TlsOptions</a><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#token">token</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#user">user</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#verbose">verbose</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#waitonfirstconnect">waitOnFirstConnect</a><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <a class="tsd-kind-property" href="#wsfactory">wsFactory</a><span class="tsd-signature-symbol">?:</span> <a href="../types/WsSocketFactory.html" class="tsd-signature-type tsd-kind-type-alias">WsSocketFactory</a><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><section class="tsd-panel tsd-hierarchy" data-refl="950"><h4>Hierarchy (<a href="../hierarchy.html#WsConnectionOptions">View Summary</a>)</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><a href="ConnectionOptions.html" class="tsd-signature-type tsd-kind-interface">ConnectionOptions</a><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">WsConnectionOptions</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in core/build/src/ws_transport.ts:55</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#authenticator" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>authenticator?</span></a>
|
||
<a href="#debug" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>debug?</span></a>
|
||
<a href="#ignoreautherrorabort" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ignore<wbr/>Auth<wbr/>Error<wbr/>Abort?</span></a>
|
||
<a href="#ignoreclusterupdates" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ignore<wbr/>Cluster<wbr/>Updates?</span></a>
|
||
<a href="#inboxprefix" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>inbox<wbr/>Prefix?</span></a>
|
||
<a href="#maxpingout" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>max<wbr/>Ping<wbr/>Out?</span></a>
|
||
<a href="#maxreconnectattempts" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>max<wbr/>Reconnect<wbr/>Attempts?</span></a>
|
||
<a href="#name" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name?</span></a>
|
||
<a href="#noasynctraces" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>no<wbr/>Async<wbr/>Traces?</span></a>
|
||
<a href="#noecho" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>no<wbr/>Echo?</span></a>
|
||
<a href="#norandomize" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>no<wbr/>Randomize?</span></a>
|
||
<a href="#pass" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pass?</span></a>
|
||
<a href="#pedantic" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pedantic?</span></a>
|
||
<a href="#pinginterval" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ping<wbr/>Interval?</span></a>
|
||
<a href="#port" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>port?</span></a>
|
||
<a href="#reconnect" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect?</span></a>
|
||
<a href="#reconnectdelayhandler" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>Delay<wbr/>Handler?</span></a>
|
||
<a href="#reconnectjitter" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>Jitter?</span></a>
|
||
<a href="#reconnectjittertls" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>JitterTLS?</span></a>
|
||
<a href="#reconnecttimewait" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>Time<wbr/>Wait?</span></a>
|
||
<a href="#resolve" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>resolve?</span></a>
|
||
<a href="#servers" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>servers?</span></a>
|
||
<a href="#timeout" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>timeout?</span></a>
|
||
<a href="#tls" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>tls?</span></a>
|
||
<a href="#token" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>token?</span></a>
|
||
<a href="#user" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>user?</span></a>
|
||
<a href="#verbose" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>verbose?</span></a>
|
||
<a href="#waitonfirstconnect" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>wait<wbr/>On<wbr/>First<wbr/>Connect?</span></a>
|
||
<a href="#wsfactory" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ws<wbr/>Factory?</span></a>
|
||
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="authenticator"><code class="tsd-tag">Optional</code><span>authenticator</span><a href="#authenticator" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">authenticator</span><span class="tsd-signature-symbol">?:</span> <a href="Authenticator.html" class="tsd-signature-type tsd-kind-interface">Authenticator</a> <span class="tsd-signature-symbol">|</span> <a href="Authenticator.html" class="tsd-signature-type tsd-kind-interface">Authenticator</a><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>When the server requires authentication, set an <a href="Authenticator.html" class="tsd-kind-interface">Authenticator</a>.
|
||
An authenticator is created automatically for username/password and token
|
||
authentication configurations
|
||
if <a href="ConnectionOptions.html#user" class="tsd-kind-property">user</a> and <a href="ConnectionOptions.html#pass" class="tsd-kind-property">pass</a> or the <a href="ConnectionOptions.html#token" class="tsd-kind-property">token</a> options are set.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#authenticator">authenticator</a></p><ul><li>Defined in core/build/src/core.ts:811</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="debug"><code class="tsd-tag">Optional</code><span>debug</span><a href="#debug" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">debug</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When set to <code>true</code> the client will print protocol messages that it receives
|
||
or sends to the server.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#debug">debug</a></p><ul><li>Defined in core/build/src/core.ts:816</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="ignoreautherrorabort"><code class="tsd-tag">Optional</code><span>ignore<wbr/>Auth<wbr/>Error<wbr/>Abort</span><a href="#ignoreautherrorabort" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">ignoreAuthErrorAbort</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>By default, NATS clients will abort reconnect if they fail authentication
|
||
twice in a row with the same error, regardless of the reconnect policy.
|
||
This option should be used with care as it will disable this behaviour when true</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#ignoreautherrorabort">ignoreAuthErrorAbort</a></p><ul><li>Defined in core/build/src/core.ts:961</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="ignoreclusterupdates"><code class="tsd-tag">Optional</code><span>ignore<wbr/>Cluster<wbr/>Updates</span><a href="#ignoreclusterupdates" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">ignoreClusterUpdates</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When set to true, cluster information gossiped by the nats-server will
|
||
not augment the lists of server(s) known by the client.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#ignoreclusterupdates">ignoreClusterUpdates</a></p><ul><li>Defined in core/build/src/core.ts:948</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="inboxprefix"><code class="tsd-tag">Optional</code><span>inbox<wbr/>Prefix</span><a href="#inboxprefix" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">inboxPrefix</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>A string prefix (must be a valid subject prefix) prepended to inboxes
|
||
generated by client. This allows a client with limited subject permissions
|
||
to specify a subject where requests can deliver responses.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#inboxprefix">inboxPrefix</a></p><ul><li>Defined in core/build/src/core.ts:954</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="maxpingout"><code class="tsd-tag">Optional</code><span>max<wbr/>Ping<wbr/>Out</span><a href="#maxpingout" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">maxPingOut</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Sets the maximum count of ping commands that can be awaiting a response
|
||
before raising a stale connection status <a href="../types/StaleConnectionStatus.html" class="tsd-kind-type-alias">StaleConnectionStatus</a>
|
||
notification <a href="NatsConnection.html#status" class="tsd-kind-method">NatsConnection#status</a> and initiating a reconnect.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-see"><h4 class="tsd-anchor-link" id="see">See<a href="#see" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>pingInterval</p>
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#maxpingout">maxPingOut</a></p><ul><li>Defined in core/build/src/core.ts:824</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="maxreconnectattempts"><code class="tsd-tag">Optional</code><span>max<wbr/>Reconnect<wbr/>Attempts</span><a href="#maxreconnectattempts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">maxReconnectAttempts</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Sets the maximum count of per-server reconnect attempts before giving up.
|
||
Set to <code>-1</code> to never give up.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default">Default<a href="#default" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">10</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#maxreconnectattempts">maxReconnectAttempts</a></p><ul><li>Defined in core/build/src/core.ts:831</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="name"><code class="tsd-tag">Optional</code><span>name</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Sets the client name. When set, the server monitoring pages will display
|
||
this name when referring to this client.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#name">name</a></p><ul><li>Defined in core/build/src/core.ts:836</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="noasynctraces"><code class="tsd-tag">Optional</code><span>no<wbr/>Async<wbr/>Traces</span><a href="#noasynctraces" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">noAsyncTraces</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When true, the client will not augment timeout and other error traces with
|
||
additional context as to where the operation was started.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#noasynctraces">noAsyncTraces</a></p><ul><li>Defined in core/build/src/core.ts:967</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="noecho"><code class="tsd-tag">Optional</code><span>no<wbr/>Echo</span><a href="#noecho" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">noEcho</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When set to true, messages published by this client will not match
|
||
this client's subscriptions, so the client is guaranteed to never
|
||
receive self-published messages on a subject that it is listening on.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#noecho">noEcho</a></p><ul><li>Defined in core/build/src/core.ts:842</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="norandomize"><code class="tsd-tag">Optional</code><span>no<wbr/>Randomize</span><a href="#norandomize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">noRandomize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>If set to true, the client will not randomize its server connection list.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#norandomize">noRandomize</a></p><ul><li>Defined in core/build/src/core.ts:846</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="pass"><code class="tsd-tag">Optional</code><span>pass</span><a href="#pass" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">pass</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Sets the password for a client connection. Requires that the <a href="ConnectionOptions.html#user" class="tsd-kind-property">user</a>
|
||
option be set. See <a href="ConnectionOptions.html#authenticator" class="tsd-kind-property">authenticator</a>.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#pass">pass</a></p><ul><li>Defined in core/build/src/core.ts:851</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="pedantic"><code class="tsd-tag">Optional</code><span>pedantic</span><a href="#pedantic" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">pedantic</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When set to true, the server may perform additional checks on protocol
|
||
message requests. This option is only useful for NATS client development
|
||
and shouldn't be used, as it affects server performance.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#pedantic">pedantic</a></p><ul><li>Defined in core/build/src/core.ts:857</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="pinginterval"><code class="tsd-tag">Optional</code><span>ping<wbr/>Interval</span><a href="#pinginterval" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">pingInterval</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Sets the number of milliseconds between client initiated ping commands.
|
||
See <a href="ConnectionOptions.html#maxpingout" class="tsd-kind-property">maxPingOut</a>.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default-1">Default<a href="#default-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">2</span><span class="hl-1"> </span><span class="hl-5">minutes</span><span class="hl-1">.</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#pinginterval">pingInterval</a></p><ul><li>Defined in core/build/src/core.ts:863</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="port"><code class="tsd-tag">Optional</code><span>port</span><a href="#port" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">port</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Sets the port number on the localhost (127.0.0.1) where the nats-server is running.
|
||
This option is mutually exclusive with <a href="ConnectionOptions.html#servers" class="tsd-kind-property">servers</a>.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#port">port</a></p><ul><li>Defined in core/build/src/core.ts:868</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="reconnect"><code class="tsd-tag">Optional</code><span>reconnect</span><a href="#reconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">reconnect</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When set to true, the server will attempt to reconnect so long as
|
||
<a href="ConnectionOptions.html#maxreconnectattempts" class="tsd-kind-property">maxReconnectAttempts</a> doesn't prevent it.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default-2">Default<a href="#default-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-4">true</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#reconnect">reconnect</a></p><ul><li>Defined in core/build/src/core.ts:874</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="reconnectdelayhandler"><code class="tsd-tag">Optional</code><span>reconnect<wbr/>Delay<wbr/>Handler</span><a href="#reconnectdelayhandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">reconnectDelayHandler</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Set a function that dynamically determines the number of milliseconds
|
||
that the client should wait for the next reconnect attempt.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#reconnectdelayhandler">reconnectDelayHandler</a></p><ul><li>Defined in core/build/src/core.ts:879</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="reconnectjitter"><code class="tsd-tag">Optional</code><span>reconnect<wbr/>Jitter</span><a href="#reconnectjitter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">reconnectJitter</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Set the upper bound for a random delay in milliseconds added to
|
||
<a href="ConnectionOptions.html#reconnecttimewait" class="tsd-kind-property">reconnectTimeWait</a>.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default-3">Default<a href="#default-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">100</span><span class="hl-1"> </span><span class="hl-5">millis</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#reconnectjitter">reconnectJitter</a></p><ul><li>Defined in core/build/src/core.ts:886</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="reconnectjittertls"><code class="tsd-tag">Optional</code><span>reconnect<wbr/>JitterTLS</span><a href="#reconnectjittertls" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">reconnectJitterTLS</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Set the upper bound for a random delay in milliseconds added to
|
||
<a href="ConnectionOptions.html#reconnecttimewait" class="tsd-kind-property">reconnectTimeWait</a>. This only affects TLS connections</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default-4">Default<a href="#default-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">1000</span><span class="hl-1"> </span><span class="hl-5">millis</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#reconnectjittertls">reconnectJitterTLS</a></p><ul><li>Defined in core/build/src/core.ts:893</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="reconnecttimewait"><code class="tsd-tag">Optional</code><span>reconnect<wbr/>Time<wbr/>Wait</span><a href="#reconnecttimewait" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">reconnectTimeWait</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Set the number of millisecods between reconnect attempts.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default-5">Default<a href="#default-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">2000</span><span class="hl-1"> </span><span class="hl-5">millis</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#reconnecttimewait">reconnectTimeWait</a></p><ul><li>Defined in core/build/src/core.ts:899</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="resolve"><code class="tsd-tag">Optional</code><span>resolve</span><a href="#resolve" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">resolve</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When false, the connect function will not perform any hostname resolution. Note that
|
||
by default this option will be true if the client supports hostname resolution.
|
||
Note that on clients that don't supported (mainly the websocket client, setting this
|
||
option to true, will throw an exception as this option is not available.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#resolve">resolve</a></p><ul><li>Defined in core/build/src/core.ts:975</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="servers"><code class="tsd-tag">Optional</code><span>servers</span><a href="#servers" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">servers</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Set the hostport(s) where the client should attempt to connect.
|
||
This option is mutually exclusive with <a href="ConnectionOptions.html#port" class="tsd-kind-property">port</a>.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default-6">Default<a href="#default-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">127.0</span><span class="hl-1">.</span><span class="hl-8">0.1</span><span class="hl-1">:</span><span class="hl-8">4222</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#servers">servers</a></p><ul><li>Defined in core/build/src/core.ts:906</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="timeout"><code class="tsd-tag">Optional</code><span>timeout</span><a href="#timeout" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">timeout</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Sets the number of milliseconds the client should wait for a server
|
||
handshake to be established.</p>
|
||
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-default"><h4 class="tsd-anchor-link" id="default-7">Default<a href="#default-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">20000</span><span class="hl-1"> </span><span class="hl-5">millis</span>
|
||
</code><button type="button">Copy</button></pre>
|
||
|
||
</div></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#timeout">timeout</a></p><ul><li>Defined in core/build/src/core.ts:913</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="tls"><code class="tsd-tag">Optional</code><span>tls</span><a href="#tls" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">tls</span><span class="tsd-signature-symbol">?:</span> <a href="TlsOptions.html" class="tsd-signature-type tsd-kind-interface">TlsOptions</a></div><div class="tsd-comment tsd-typography"><p>When set (can be an empty object), the client requires a secure connection.
|
||
TlsOptions honored depend on the runtime. Consult the specific NATS javascript
|
||
client GitHub repo/documentation. When set to null, the client should fail
|
||
should not connect using TLS. In the case where TLS is available on the server
|
||
a standard connection will be used. If TLS is required, the connection will fail.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#tls">tls</a></p><ul><li>Defined in core/build/src/core.ts:921</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="token"><code class="tsd-tag">Optional</code><span>token</span><a href="#token" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">token</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Set to a client authentication token. Note that these tokens are
|
||
a specific authentication strategy on the nats-server. This option
|
||
is mutually exclusive of <a href="ConnectionOptions.html#user" class="tsd-kind-property">user</a> and <a href="ConnectionOptions.html#pass" class="tsd-kind-property">pass</a>. See <a href="ConnectionOptions.html#authenticator" class="tsd-kind-property">authenticator</a>.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#token">token</a></p><ul><li>Defined in core/build/src/core.ts:927</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="user"><code class="tsd-tag">Optional</code><span>user</span><a href="#user" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">user</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>Sets the username for a client connection. Requires that the <a href="ConnectionOptions.html#pass" class="tsd-kind-property">pass</a>
|
||
option be set. See <a href="ConnectionOptions.html#authenticator" class="tsd-kind-property">authenticator</a>.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#user">user</a></p><ul><li>Defined in core/build/src/core.ts:932</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="verbose"><code class="tsd-tag">Optional</code><span>verbose</span><a href="#verbose" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">verbose</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When set to true, the server will send response to all server commands.
|
||
This option is only useful for NATS client development and shouldn't
|
||
be used, as it affects server performance.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#verbose">verbose</a></p><ul><li>Defined in core/build/src/core.ts:938</li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="waitonfirstconnect"><code class="tsd-tag">Optional</code><span>wait<wbr/>On<wbr/>First<wbr/>Connect</span><a href="#waitonfirstconnect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">waitOnFirstConnect</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>When set to true <a href="ConnectionOptions.html#maxreconnectattempts" class="tsd-kind-property">maxReconnectAttempts</a> will not trigger until the client
|
||
has established one connection.</p>
|
||
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="ConnectionOptions.html">ConnectionOptions</a>.<a href="ConnectionOptions.html#waitonfirstconnect">waitOnFirstConnect</a></p><ul><li>Defined in core/build/src/core.ts:943</li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="wsfactory"><code class="tsd-tag">Optional</code><span>ws<wbr/>Factory</span><a href="#wsfactory" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">wsFactory</span><span class="tsd-signature-symbol">?:</span> <a href="../types/WsSocketFactory.html" class="tsd-signature-type tsd-kind-type-alias">WsSocketFactory</a></div><aside class="tsd-sources"><ul><li>Defined in core/build/src/ws_transport.ts:56</li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#authenticator" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>authenticator</span></a><a href="#debug" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>debug</span></a><a href="#ignoreautherrorabort" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ignore<wbr/>Auth<wbr/>Error<wbr/>Abort</span></a><a href="#ignoreclusterupdates" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ignore<wbr/>Cluster<wbr/>Updates</span></a><a href="#inboxprefix" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>inbox<wbr/>Prefix</span></a><a href="#maxpingout" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>max<wbr/>Ping<wbr/>Out</span></a><a href="#maxreconnectattempts" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>max<wbr/>Reconnect<wbr/>Attempts</span></a><a href="#name" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>name</span></a><a href="#noasynctraces" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>no<wbr/>Async<wbr/>Traces</span></a><a href="#noecho" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>no<wbr/>Echo</span></a><a href="#norandomize" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>no<wbr/>Randomize</span></a><a href="#pass" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pass</span></a><a href="#pedantic" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pedantic</span></a><a href="#pinginterval" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ping<wbr/>Interval</span></a><a href="#port" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>port</span></a><a href="#reconnect" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect</span></a><a href="#reconnectdelayhandler" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>Delay<wbr/>Handler</span></a><a href="#reconnectjitter" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>Jitter</span></a><a href="#reconnectjittertls" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>JitterTLS</span></a><a href="#reconnecttimewait" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>reconnect<wbr/>Time<wbr/>Wait</span></a><a href="#resolve" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>resolve</span></a><a href="#servers" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>servers</span></a><a href="#timeout" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>timeout</span></a><a href="#tls" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>tls</span></a><a href="#token" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>token</span></a><a href="#user" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>user</span></a><a href="#verbose" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>verbose</span></a><a href="#waitonfirstconnect" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>wait<wbr/>On<wbr/>First<wbr/>Connect</span></a><a href="#wsfactory"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>ws<wbr/>Factory</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@nats-io/nats-core</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|