@ngrok/ngrok 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/Cargo.toml +1 -1
- package/README.md +16 -9
- package/docs/assets/highlight.css +13 -6
- package/docs/assets/main.js +3 -3
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +447 -361
- package/docs/classes/NgrokHttpTunnel.html +112 -77
- package/docs/classes/NgrokHttpTunnelBuilder.html +235 -199
- package/docs/classes/NgrokLabeledTunnel.html +107 -72
- package/docs/classes/NgrokLabeledTunnelBuilder.html +84 -49
- package/docs/classes/NgrokSession.html +99 -66
- package/docs/classes/NgrokSessionBuilder.html +171 -138
- package/docs/classes/NgrokTcpTunnel.html +112 -77
- package/docs/classes/NgrokTcpTunnelBuilder.html +115 -80
- package/docs/classes/NgrokTlsTunnel.html +112 -77
- package/docs/classes/NgrokTlsTunnelBuilder.html +133 -98
- package/docs/classes/UpdateRequest.html +69 -33
- package/docs/functions/authtoken.html +88 -0
- package/docs/functions/connect.html +88 -0
- package/docs/functions/consoleLog.html +50 -34
- package/docs/functions/disconnect.html +88 -0
- package/docs/functions/kill.html +83 -0
- package/docs/functions/listen.html +52 -36
- package/docs/functions/listenable.html +51 -35
- package/docs/functions/loggingCallback.html +56 -40
- package/docs/index.html +94 -101
- package/docs/interfaces/Config.html +608 -0
- package/docs/modules.html +74 -47
- package/examples/ngrok-connect-full.js +64 -0
- package/examples/ngrok-connect-minimal.js +16 -0
- package/examples/ngrok-http-full.js +9 -11
- package/examples/ngrok-http-minimum.js +8 -12
- package/examples/ngrok-labeled.js +5 -5
- package/examples/ngrok-listen.js +2 -2
- package/examples/ngrok-tcp.js +5 -6
- package/examples/ngrok-tls.js +5 -5
- package/examples/ngrok-typescript.ts +3 -3
- package/examples/ngrok-windows-pipe.js +1 -1
- package/examples/ngrok-winston.js +2 -2
- package/index.d.ts +234 -15
- package/index.js +118 -3
- package/package.json +16 -16
- package/src/config.rs +182 -0
- package/src/connect.rs +328 -0
- package/src/http.rs +5 -4
- package/src/lib.rs +2 -0
- package/src/session.rs +61 -4
- package/src/tls.rs +1 -1
- package/src/tunnel.rs +105 -37
- package/src/tunnel_builder.rs +8 -0
- package/trailer.js +113 -2
package/docs/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@ngrok/ngrok</title><meta name="description" content="Documentation for @ngrok/ngrok"/><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 async src="assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@ngrok/ngrok</title><meta name="description" content="Documentation for @ngrok/ngrok"/><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/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base=".">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -9,14 +9,10 @@
|
|
|
9
9
|
<li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@ngrok/ngrok</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
|
-
<div class="col-
|
|
12
|
+
<div class="col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
14
|
<h2>@ngrok/ngrok</h2></div>
|
|
15
|
-
<div class="tsd-panel tsd-typography">
|
|
16
|
-
<a href="#the-ngrok-agent-sdk-for-nodejs" id="the-ngrok-agent-sdk-for-nodejs" style="color: inherit; text-decoration: none;">
|
|
17
|
-
<h1>The ngrok Agent SDK for NodeJS</h1>
|
|
18
|
-
</a>
|
|
19
|
-
<p><a href="https://www.npmjs.com/package/@ngrok/ngrok"><img src="https://img.shields.io/npm/v/@ngrok/ngrok.svg" alt="npm.rs"></a>
|
|
15
|
+
<div class="tsd-panel tsd-typography"><a id="md:the-ngrok-agent-sdk-for-nodejs" class="tsd-anchor"></a><h1><a href="#md:the-ngrok-agent-sdk-for-nodejs">The ngrok Agent SDK for NodeJS</a></h1><p><a href="https://www.npmjs.com/package/@ngrok/ngrok"><img src="https://img.shields.io/npm/v/@ngrok/ngrok.svg" alt="npm.rs"></a>
|
|
20
16
|
<a href="https://github.com/ngrok/ngrok-rs/blob/main/LICENSE-MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT licensed"></a>
|
|
21
17
|
<a href="https://github.com/ngrok/ngrok-rs/blob/main/LICENSE-APACHE"><img src="https://img.shields.io/badge/license-Apache_2.0-blue.svg" alt="Apache-2.0 licensed"></a>
|
|
22
18
|
<a href="https://github.com/ngrok/ngrok-js/actions/workflows/ci.yml"><img src="https://github.com/ngrok/ngrok-js/actions/workflows/ci.yml/badge.svg" alt="Continuous integration"></a></p>
|
|
@@ -27,44 +23,27 @@ deployed inside a private network and is used to communicate with the ngrok clou
|
|
|
27
23
|
<p>This is the ngrok agent in library form, suitable for integrating directly into NodeJS
|
|
28
24
|
applications. This allows you to quickly build ngrok into your application with no separate process
|
|
29
25
|
to manage.</p>
|
|
30
|
-
|
|
31
|
-
<a href="#installation" id="installation" style="color: inherit; text-decoration: none;">
|
|
32
|
-
<h1>Installation</h1>
|
|
33
|
-
</a>
|
|
34
|
-
<p>The published library is available on
|
|
26
|
+
<a id="md:installation" class="tsd-anchor"></a><h1><a href="#md:installation">Installation</a></h1><p>The published library is available on
|
|
35
27
|
<a href="https://www.npmjs.com/package/@ngrok/ngrok">npm</a>.</p>
|
|
36
28
|
<pre><code class="language-shell"><span class="hl-0">npm </span><span class="hl-1">install</span><span class="hl-0"> </span><span class="hl-1">@ngrok/ngrok</span>
|
|
37
|
-
</code></pre>
|
|
38
|
-
|
|
39
|
-
<a
|
|
40
|
-
<h1>Documentation</h1>
|
|
41
|
-
</a>
|
|
42
|
-
<p>A quickstart guide and a full API reference are included in the <a href="https://ngrok.github.io/ngrok-js/">ngrok-js TypeScript API documentation</a>.</p>
|
|
43
|
-
|
|
44
|
-
<a href="#quickstart" id="quickstart" style="color: inherit; text-decoration: none;">
|
|
45
|
-
<h1>Quickstart</h1>
|
|
46
|
-
</a>
|
|
47
|
-
<p>After you've installed the package, you'll need an Auth Token. Retrieve one on the
|
|
29
|
+
</code><button>Copy</button></pre>
|
|
30
|
+
<a id="md:documentation" class="tsd-anchor"></a><h1><a href="#md:documentation">Documentation</a></h1><p>A quickstart guide and a full API reference are included in the <a href="https://ngrok.github.io/ngrok-js/">ngrok-js TypeScript API documentation</a>.</p>
|
|
31
|
+
<a id="md:quickstart" class="tsd-anchor"></a><h1><a href="#md:quickstart">Quickstart</a></h1><p>After you've installed the package, you'll need an Auth Token. Retrieve one on the
|
|
48
32
|
<a href="https://dashboard.ngrok.com/get-started/your-authtoken">Auth Token page of your ngrok dashboard</a></p>
|
|
49
33
|
<p>There are multiple examples in <a href="https://github.com/ngrok/ngrok-js/tree/main/examples">the /examples directory</a>.
|
|
50
|
-
A minimal use-case looks like the following
|
|
51
|
-
<pre><code class="language-jsx"><span class="hl-2">
|
|
52
|
-
</code></pre>
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
</a>
|
|
57
|
-
<p>Degit can be used for cloning and running an example directory like this:</p>
|
|
34
|
+
A minimal use-case looks like <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-http-minimum.js">the following</a>:</p>
|
|
35
|
+
<pre><code class="language-jsx"><span class="hl-2">var</span><span class="hl-0"> </span><span class="hl-3">ngrok</span><span class="hl-0"> = </span><span class="hl-4">require</span><span class="hl-0">(</span><span class="hl-1">"@ngrok/ngrok"</span><span class="hl-0">);</span><br/><br/><span class="hl-2">async</span><span class="hl-0"> </span><span class="hl-2">function</span><span class="hl-0"> </span><span class="hl-4">create_tunnel</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-2">const</span><span class="hl-0"> </span><span class="hl-5">session</span><span class="hl-0"> = </span><span class="hl-6">await</span><span class="hl-0"> </span><span class="hl-2">new</span><span class="hl-0"> </span><span class="hl-3">ngrok</span><span class="hl-0">.</span><span class="hl-4">NgrokSessionBuilder</span><span class="hl-0">().</span><span class="hl-4">authtokenFromEnv</span><span class="hl-0">().</span><span class="hl-4">connect</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-2">const</span><span class="hl-0"> </span><span class="hl-5">tunnel</span><span class="hl-0"> = </span><span class="hl-6">await</span><span class="hl-0"> </span><span class="hl-3">session</span><span class="hl-0">.</span><span class="hl-4">httpEndpoint</span><span class="hl-0">().</span><span class="hl-4">listen</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-4">log</span><span class="hl-0">(</span><span class="hl-1">"Ingress established at:"</span><span class="hl-0">, </span><span class="hl-3">tunnel</span><span class="hl-0">.</span><span class="hl-4">url</span><span class="hl-0">());</span><br/><span class="hl-0"> </span><span class="hl-3">tunnel</span><span class="hl-0">.</span><span class="hl-4">forwardTcp</span><span class="hl-0">(</span><span class="hl-1">"localhost:8081"</span><span class="hl-0">);</span><br/><span class="hl-0">}</span>
|
|
36
|
+
</code><button>Copy</button></pre>
|
|
37
|
+
<p>or <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-connect-minimal.js">with the 'connect' convenience function</a>:</p>
|
|
38
|
+
<pre><code class="language-jsx"><span class="hl-2">const</span><span class="hl-0"> </span><span class="hl-5">ngrok</span><span class="hl-0"> = </span><span class="hl-4">require</span><span class="hl-0">(</span><span class="hl-1">"@ngrok/ngrok"</span><span class="hl-0">);</span><br/><span class="hl-3">ngrok</span><span class="hl-0">.</span><span class="hl-4">connect</span><span class="hl-0">({</span><span class="hl-3">addr:</span><span class="hl-0"> </span><span class="hl-7">8080</span><span class="hl-0">, </span><span class="hl-3">authtoken_from_env:</span><span class="hl-0"> </span><span class="hl-2">true</span><span class="hl-0">}).</span><span class="hl-4">then</span><span class="hl-0">((</span><span class="hl-3">url</span><span class="hl-0">) </span><span class="hl-2">=></span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-4">log</span><span class="hl-0">(</span><span class="hl-1">`Ingress established at: </span><span class="hl-2">${</span><span class="hl-3">url</span><span class="hl-2">}</span><span class="hl-1">`</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
|
|
39
|
+
</code><button>Copy</button></pre>
|
|
40
|
+
<a id="md:examples" class="tsd-anchor"></a><h1><a href="#md:examples">Examples</a></h1><p>Degit can be used for cloning and running an example directory like this:</p>
|
|
58
41
|
<pre><code class="language-bash"><span class="hl-0">npx </span><span class="hl-1">degit</span><span class="hl-0"> </span><span class="hl-1">github:ngrok/ngrok-js/examples/</span><span class="hl-0"><</span><span class="hl-1">exampl</span><span class="hl-0">e> <</span><span class="hl-1">folder-nam</span><span class="hl-0">e></span><br/><span class="hl-4">cd</span><span class="hl-0"> <</span><span class="hl-1">folder-nam</span><span class="hl-0">e></span><br/><span class="hl-0">npm </span><span class="hl-1">i</span>
|
|
59
|
-
</code></pre>
|
|
42
|
+
</code><button>Copy</button></pre>
|
|
60
43
|
<p>For example:</p>
|
|
61
44
|
<pre><code class="language-bash"><span class="hl-0">npx </span><span class="hl-1">degit</span><span class="hl-0"> </span><span class="hl-1">github:ngrok/ngrok-js/examples/express</span><span class="hl-0"> </span><span class="hl-1">express</span><span class="hl-0"> && </span><span class="hl-4">cd</span><span class="hl-0"> </span><span class="hl-1">express</span><span class="hl-0"> && npm </span><span class="hl-1">i</span>
|
|
62
|
-
</code></pre>
|
|
63
|
-
|
|
64
|
-
<a href="#frameworks" id="frameworks" style="color: inherit; text-decoration: none;">
|
|
65
|
-
<h2>Frameworks</h2>
|
|
66
|
-
</a>
|
|
67
|
-
<ul>
|
|
45
|
+
</code><button>Copy</button></pre>
|
|
46
|
+
<a id="md:frameworks" class="tsd-anchor"></a><h2><a href="#md:frameworks">Frameworks</a></h2><ul>
|
|
68
47
|
<li><a href="https://expressjs.com/">Express</a> - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/express/ngrok-express-quickstart.js">Quickstart Example</a>, <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/express/ngrok-express.js">Configuration Example</a></li>
|
|
69
48
|
<li><a href="https://www.fastify.io/">Fastify</a> - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/fastify/ngrok-fastify.js">Example</a></li>
|
|
70
49
|
<li><a href="https://hapi.dev/">Hapi</a> - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/hapi/ngrok-hapi.js">Example</a></li>
|
|
@@ -77,37 +56,22 @@ A minimal use-case looks like the following:</p>
|
|
|
77
56
|
<li><a href="https://vuejs.org/">Vue</a> - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/vue/vite.config.ts">Example vite.config.ts</a> loading <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/vue/ngrok.config.ts">ngrok.config.ts</a></li>
|
|
78
57
|
<li><a href="https://github.com/winstonjs/winston#readme">Winston</a> Logging - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-winston.js">Example</a></li>
|
|
79
58
|
</ul>
|
|
80
|
-
|
|
81
|
-
<a href="
|
|
82
|
-
<h2>Tunnel Types</h2>
|
|
83
|
-
</a>
|
|
84
|
-
<ul>
|
|
59
|
+
<a id="md:tunnel-types" class="tsd-anchor"></a><h2><a href="#md:tunnel-types">Tunnel Types</a></h2><ul>
|
|
60
|
+
<li>ngrok.connect - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-connect-minimal.js">ngrok.connect Minimal Example</a>, <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-connect-full.js">Full ngrok.connect Example</a></li>
|
|
85
61
|
<li>HTTP - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-listen.js">ngrok.listen Example</a>, <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-http-minimum.js">Minimal Example</a>, <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-http-full.js">Full Configuration Example</a></li>
|
|
86
62
|
<li>Labeled - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-labeled.js">Example</a></li>
|
|
87
63
|
<li>TCP - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-tcp.js">Example</a></li>
|
|
88
64
|
<li>TLS - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-tls.js">Example</a></li>
|
|
89
65
|
<li>Windows Pipe - <a href="https://github.com/ngrok/ngrok-js/blob/main/examples/ngrok-windows-pipe.js">Example</a></li>
|
|
90
66
|
</ul>
|
|
91
|
-
|
|
92
|
-
<a href="#async-programming" id="async-programming" style="color: inherit; text-decoration: none;">
|
|
93
|
-
<h1>Async Programming</h1>
|
|
94
|
-
</a>
|
|
95
|
-
<p>All methods return a <code>Promise</code> and are suitable for use in asynchronous
|
|
67
|
+
<a id="md:async-programming" class="tsd-anchor"></a><h1><a href="#md:async-programming">Async Programming</a></h1><p>All methods return a <code>Promise</code> and are suitable for use in asynchronous
|
|
96
68
|
programming. You can use callback chaining with <code>.then()</code> and <code>.catch()</code> syntax
|
|
97
69
|
or the <code>await</code> keyword to wait for completion of an API call.</p>
|
|
98
|
-
|
|
99
|
-
<a href="#error-handling" id="error-handling" style="color: inherit; text-decoration: none;">
|
|
100
|
-
<h3>Error Handling</h3>
|
|
101
|
-
</a>
|
|
102
|
-
<p>The asynchronous functions will throw an error on failure to set up a session or tunnel,
|
|
70
|
+
<a id="md:error-handling" class="tsd-anchor"></a><h3><a href="#md:error-handling">Error Handling</a></h3><p>The asynchronous functions will throw an error on failure to set up a session or tunnel,
|
|
103
71
|
which can be caught and dealt with using standard then/catch semantics.</p>
|
|
104
|
-
<pre><code class="language-jsx"><span class="hl-2">new</span><span class="hl-0"> </span><span class="hl-
|
|
105
|
-
</code></pre>
|
|
106
|
-
|
|
107
|
-
<a href="#platform-support" id="platform-support" style="color: inherit; text-decoration: none;">
|
|
108
|
-
<h1>Platform Support</h1>
|
|
109
|
-
</a>
|
|
110
|
-
<p>Pre-built binaries are provided on NPM for the following platforms:</p>
|
|
72
|
+
<pre><code class="language-jsx"><span class="hl-2">new</span><span class="hl-0"> </span><span class="hl-3">ngrok</span><span class="hl-0">.</span><span class="hl-4">NgrokSessionBuilder</span><span class="hl-0">().</span><span class="hl-4">authtokenFromEnv</span><span class="hl-0">().</span><span class="hl-4">connect</span><span class="hl-0">()</span><br/><span class="hl-0"> .</span><span class="hl-4">then</span><span class="hl-0">((</span><span class="hl-3">session</span><span class="hl-0">) </span><span class="hl-2">=></span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">session</span><span class="hl-0">.</span><span class="hl-4">httpEndpoint</span><span class="hl-0">().</span><span class="hl-4">listen</span><span class="hl-0">()</span><br/><span class="hl-0"> .</span><span class="hl-4">then</span><span class="hl-0">((</span><span class="hl-3">tun</span><span class="hl-0">) </span><span class="hl-2">=></span><span class="hl-0"> {})</span><br/><span class="hl-0"> .</span><span class="hl-4">catch</span><span class="hl-0">(</span><span class="hl-3">err</span><span class="hl-0"> </span><span class="hl-2">=></span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-4">log</span><span class="hl-0">(</span><span class="hl-1">'tunnel setup error: '</span><span class="hl-0"> + </span><span class="hl-3">err</span><span class="hl-0">))</span><br/><span class="hl-0"> })</span><br/><span class="hl-0"> .</span><span class="hl-4">catch</span><span class="hl-0">(</span><span class="hl-3">err</span><span class="hl-0"> </span><span class="hl-2">=></span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-4">log</span><span class="hl-0">(</span><span class="hl-1">'session setup error: '</span><span class="hl-0"> + </span><span class="hl-3">err</span><span class="hl-0">))</span><br/><span class="hl-0"> .</span><span class="hl-3">await</span><span class="hl-0">;</span>
|
|
73
|
+
</code><button>Copy</button></pre>
|
|
74
|
+
<a id="md:platform-support" class="tsd-anchor"></a><h1><a href="#md:platform-support">Platform Support</a></h1><p>Pre-built binaries are provided on NPM for the following platforms:</p>
|
|
111
75
|
<table>
|
|
112
76
|
<thead>
|
|
113
77
|
<tr>
|
|
@@ -165,16 +129,8 @@ which can be caught and dealt with using standard then/catch semantics.</p>
|
|
|
165
129
|
<ul>
|
|
166
130
|
<li>Windows-aarch64 will be supported after the next release of <a href="https://github.com/briansmith/ring/issues/1167">Ring</a>.</li>
|
|
167
131
|
</ul>
|
|
168
|
-
|
|
169
|
-
<a
|
|
170
|
-
<h1>Dependencies</h1>
|
|
171
|
-
</a>
|
|
172
|
-
<p>This project relies on <a href="https://napi.rs/">NAPI-RS</a>, an excellent system to ease development and building of Rust plugins for NodeJS.</p>
|
|
173
|
-
|
|
174
|
-
<a href="#license" id="license" style="color: inherit; text-decoration: none;">
|
|
175
|
-
<h1>License</h1>
|
|
176
|
-
</a>
|
|
177
|
-
<p>This project is licensed under either of</p>
|
|
132
|
+
<a id="md:dependencies" class="tsd-anchor"></a><h1><a href="#md:dependencies">Dependencies</a></h1><p>This project relies on <a href="https://napi.rs/">NAPI-RS</a>, an excellent system to ease development and building of Rust plugins for NodeJS.</p>
|
|
133
|
+
<a id="md:license" class="tsd-anchor"></a><h1><a href="#md:license">License</a></h1><p>This project is licensed under either of</p>
|
|
178
134
|
<ul>
|
|
179
135
|
<li>Apache License, Version 2.0, (<a href="LICENSE-APACHE">LICENSE-APACHE</a> or
|
|
180
136
|
<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
|
|
@@ -182,18 +138,15 @@ which can be caught and dealt with using standard then/catch semantics.</p>
|
|
|
182
138
|
<a href="http://opensource.org/licenses/MIT">http://opensource.org/licenses/MIT</a>)</li>
|
|
183
139
|
</ul>
|
|
184
140
|
<p>at your option.</p>
|
|
185
|
-
|
|
186
|
-
<a href="#contribution" id="contribution" style="color: inherit; text-decoration: none;">
|
|
187
|
-
<h3>Contribution</h3>
|
|
188
|
-
</a>
|
|
189
|
-
<p>Unless you explicitly state otherwise, any contribution intentionally submitted
|
|
141
|
+
<a id="md:contribution" class="tsd-anchor"></a><h3><a href="#md:contribution">Contribution</a></h3><p>Unless you explicitly state otherwise, any contribution intentionally submitted
|
|
190
142
|
for inclusion in tokio-core by you, as defined in the Apache-2.0 license, shall be
|
|
191
143
|
dual licensed as above, without any additional terms or conditions.</p>
|
|
192
144
|
</div></div>
|
|
193
|
-
<div class="col-
|
|
145
|
+
<div class="col-sidebar">
|
|
146
|
+
<div class="page-menu">
|
|
194
147
|
<div class="tsd-navigation settings">
|
|
195
148
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
196
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg>
|
|
149
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg>Settings</h3></summary>
|
|
197
150
|
<div class="tsd-accordion-details">
|
|
198
151
|
<div class="tsd-filter-visibility">
|
|
199
152
|
<h4 class="uppercase">Member Visibility</h4><form>
|
|
@@ -203,31 +156,71 @@ dual licensed as above, without any additional terms or conditions.</p>
|
|
|
203
156
|
<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>
|
|
204
157
|
<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></form></div>
|
|
205
158
|
<div class="tsd-theme-toggle">
|
|
206
|
-
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
207
|
-
<
|
|
208
|
-
<
|
|
209
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
159
|
+
<h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
160
|
+
<details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
|
|
161
|
+
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg>On This Page</h3></summary>
|
|
210
162
|
<div class="tsd-accordion-details">
|
|
211
163
|
<ul>
|
|
212
|
-
<li
|
|
213
|
-
<ul
|
|
214
|
-
<
|
|
164
|
+
<li>
|
|
165
|
+
<ul>
|
|
166
|
+
<li><a href="#md:the-ngrok-agent-sdk-for-nodejs"><span>The ngrok <wbr/>Agent SDK for <wbr/>NodeJS</span></a></li>
|
|
167
|
+
<li><a href="#md:installation"><span>Installation</span></a></li>
|
|
168
|
+
<li><a href="#md:documentation"><span>Documentation</span></a></li>
|
|
169
|
+
<li><a href="#md:quickstart"><span>Quickstart</span></a></li>
|
|
170
|
+
<li><a href="#md:examples"><span>Examples</span></a></li>
|
|
171
|
+
<li>
|
|
172
|
+
<ul>
|
|
173
|
+
<li><a href="#md:frameworks"><span>Frameworks</span></a></li>
|
|
174
|
+
<li><a href="#md:tunnel-types"><span>Tunnel <wbr/>Types</span></a></li></ul></li>
|
|
175
|
+
<li><a href="#md:async-programming"><span>Async <wbr/>Programming</span></a></li>
|
|
176
|
+
<li>
|
|
177
|
+
<ul>
|
|
178
|
+
<li><a href="#md:error-handling"><span>Error <wbr/>Handling</span></a></li></ul></li>
|
|
179
|
+
<li><a href="#md:platform-support"><span>Platform <wbr/>Support</span></a></li>
|
|
180
|
+
<li><a href="#md:dependencies"><span>Dependencies</span></a></li>
|
|
181
|
+
<li><a href="#md:license"><span>License</span></a></li>
|
|
182
|
+
<li>
|
|
215
183
|
<ul>
|
|
216
|
-
<li
|
|
217
|
-
<
|
|
218
|
-
<
|
|
219
|
-
<
|
|
220
|
-
<li
|
|
221
|
-
<
|
|
222
|
-
<
|
|
223
|
-
<
|
|
224
|
-
<li
|
|
225
|
-
<li
|
|
226
|
-
<li
|
|
227
|
-
<li
|
|
228
|
-
<li
|
|
229
|
-
<li
|
|
230
|
-
<li
|
|
231
|
-
<
|
|
184
|
+
<li><a href="#md:contribution"><span>Contribution</span></a></li></ul></li></ul></li></ul></div></details></div>
|
|
185
|
+
<div class="site-menu">
|
|
186
|
+
<nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4-path"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)" id="icon-4-text"></path></svg><span>@ngrok/ngrok</span></a>
|
|
187
|
+
<ul class="tsd-small-nested-navigation">
|
|
188
|
+
<li>
|
|
189
|
+
<details class="tsd-index-accordion" data-key="Functions"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg><span>Functions</span></summary>
|
|
190
|
+
<div class="tsd-accordion-details">
|
|
191
|
+
<ul class="tsd-nested-navigation">
|
|
192
|
+
<li><a href="interfaces/Config.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-256-path"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)" id="icon-256-text"></path></svg><span>Config</span></a></li>
|
|
193
|
+
<li><a href="functions/authtoken.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg><span>authtoken</span></a></li>
|
|
194
|
+
<li><a href="functions/connect.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg><span>connect</span></a></li>
|
|
195
|
+
<li><a href="functions/consoleLog.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg><span>console<wbr/>Log</span></a></li>
|
|
196
|
+
<li><a href="functions/disconnect.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg><span>disconnect</span></a></li>
|
|
197
|
+
<li><a href="functions/kill.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg><span>kill</span></a></li>
|
|
198
|
+
<li><a href="functions/listen.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg><span>listen</span></a></li>
|
|
199
|
+
<li><a href="functions/listenable.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg><span>listenable</span></a></li>
|
|
200
|
+
<li><a href="functions/loggingCallback.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg><span>logging<wbr/>Callback</span></a></li></ul></div></details></li>
|
|
201
|
+
<li>
|
|
202
|
+
<details class="tsd-index-accordion" data-key="Sessions"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg><span>Sessions</span></summary>
|
|
203
|
+
<div class="tsd-accordion-details">
|
|
204
|
+
<ul class="tsd-nested-navigation">
|
|
205
|
+
<li><a href="classes/NgrokSession.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-128-path"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)" id="icon-128-text"></path></svg><span>Ngrok<wbr/>Session</span></a></li>
|
|
206
|
+
<li><a href="classes/NgrokSessionBuilder.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Session<wbr/>Builder</span></a></li>
|
|
207
|
+
<li><a href="classes/UpdateRequest.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Update<wbr/>Request</span></a></li></ul></div></details></li>
|
|
208
|
+
<li>
|
|
209
|
+
<details class="tsd-index-accordion" data-key="Tunnel Builders"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg><span>Tunnel Builders</span></summary>
|
|
210
|
+
<div class="tsd-accordion-details">
|
|
211
|
+
<ul class="tsd-nested-navigation">
|
|
212
|
+
<li><a href="classes/NgrokHttpTunnelBuilder.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Http<wbr/>Tunnel<wbr/>Builder</span></a></li>
|
|
213
|
+
<li><a href="classes/NgrokLabeledTunnelBuilder.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Labeled<wbr/>Tunnel<wbr/>Builder</span></a></li>
|
|
214
|
+
<li><a href="classes/NgrokTcpTunnelBuilder.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Tcp<wbr/>Tunnel<wbr/>Builder</span></a></li>
|
|
215
|
+
<li><a href="classes/NgrokTlsTunnelBuilder.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Tls<wbr/>Tunnel<wbr/>Builder</span></a></li></ul></div></details></li>
|
|
216
|
+
<li>
|
|
217
|
+
<details class="tsd-index-accordion" data-key="Tunnels"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg><span>Tunnels</span></summary>
|
|
218
|
+
<div class="tsd-accordion-details">
|
|
219
|
+
<ul class="tsd-nested-navigation">
|
|
220
|
+
<li><a href="classes/NgrokHttpTunnel.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Http<wbr/>Tunnel</span></a></li>
|
|
221
|
+
<li><a href="classes/NgrokLabeledTunnel.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Labeled<wbr/>Tunnel</span></a></li>
|
|
222
|
+
<li><a href="classes/NgrokTcpTunnel.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Tcp<wbr/>Tunnel</span></a></li>
|
|
223
|
+
<li><a href="classes/NgrokTlsTunnel.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Ngrok<wbr/>Tls<wbr/>Tunnel</span></a></li></ul></div></details></li></ul></nav></div></div></div>
|
|
224
|
+
<div class="tsd-generator">
|
|
232
225
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
233
|
-
<div class="overlay"></div
|
|
226
|
+
<div class="overlay"></div></body></html>
|