8
8
[ npm-badge ] : https://img.shields.io/npm/v/@ngrok/ngrok.svg
9
9
[ npm-url ] : https://www.npmjs.com/package/@ngrok/ngrok
10
10
[ mit-badge ] : https://img.shields.io/badge/license-MIT-blue.svg
11
- [ mit-url ] : https://github.com/ngrok/ngrok-rs /blob/main/LICENSE-MIT
11
+ [ mit-url ] : https://github.com/ngrok/ngrok-rust /blob/main/LICENSE-MIT
12
12
[ apache-badge ] : https://img.shields.io/badge/license-Apache_2.0-blue.svg
13
- [ apache-url ] : https://github.com/ngrok/ngrok-rs /blob/main/LICENSE-APACHE
14
- [ ci-badge ] : https://github.com/ngrok/ngrok-js /actions/workflows/ci.yml/badge.svg
15
- [ ci-url ] : https://github.com/ngrok/ngrok-js /actions/workflows/ci.yml
13
+ [ apache-url ] : https://github.com/ngrok/ngrok-rust /blob/main/LICENSE-APACHE
14
+ [ ci-badge ] : https://github.com/ngrok/ngrok-nodejs /actions/workflows/ci.yml/badge.svg
15
+ [ ci-url ] : https://github.com/ngrok/ngrok-nodejs /actions/workflows/ci.yml
16
16
17
17
** Note: This is beta-quality software. Interfaces may change without warning.**
18
18
@@ -35,15 +35,15 @@ npm install @ngrok/ngrok
35
35
36
36
# Documentation
37
37
38
- A quickstart guide and a full API reference are included in the [ ngrok-js API documentation] ( https://ngrok.github.io/ngrok-js / ) .
38
+ A quickstart guide and a full API reference are included in the [ ngrok-nodejs API documentation] ( https://ngrok.github.io/ngrok-nodejs / ) .
39
39
40
40
# Quickstart
41
41
42
42
After you've installed the package, you'll need an Auth Token. Retrieve one on the
43
43
[ Auth Token page of your ngrok dashboard] ( https://dashboard.ngrok.com/get-started/your-authtoken )
44
44
45
- There are multiple examples in [ the /examples directory] ( https://github.com/ngrok/ngrok-js /tree/main/examples ) .
46
- A minimal use-case looks like [ the following] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-http-minimum.js ) :
45
+ There are multiple examples in [ the /examples directory] ( https://github.com/ngrok/ngrok-nodejs /tree/main/examples ) .
46
+ A minimal use-case looks like [ the following] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-http-minimum.js ) :
47
47
48
48
``` jsx
49
49
var ngrok = require (" @ngrok/ngrok" );
@@ -56,7 +56,7 @@ async function create_tunnel() {
56
56
}
57
57
```
58
58
59
- or [ with the 'connect' convenience function] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-connect-minimal.js ) :
59
+ or [ with the 'connect' convenience function] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-connect-minimal.js ) :
60
60
61
61
``` jsx
62
62
const ngrok = require (" @ngrok/ngrok" );
@@ -69,36 +69,36 @@ ngrok.connect({addr: 8080, authtoken_from_env: true}).then((url) => {
69
69
70
70
Degit can be used for cloning and running an example directory like this:
71
71
``` bash
72
- npx degit github:ngrok/ngrok-js /examples/< example> < folder-name>
72
+ npx degit github:ngrok/ngrok-nodejs /examples/< example> < folder-name>
73
73
cd < folder-name>
74
74
npm i
75
75
```
76
76
For example:
77
77
``` bash
78
- npx degit github:ngrok/ngrok-js /examples/express express && cd express && npm i
78
+ npx degit github:ngrok/ngrok-nodejs /examples/express express && cd express && npm i
79
79
```
80
80
81
81
82
82
## Frameworks
83
- * [ Express] ( https://expressjs.com/ ) - [ Quickstart Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/express/ngrok-express-quickstart.js ) , [ Configuration Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/express/ngrok-express.js )
84
- * [ Fastify] ( https://www.fastify.io/ ) - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/fastify/ngrok-fastify.js )
85
- * [ Hapi] ( https://hapi.dev/ ) - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/hapi/ngrok-hapi.js )
86
- * [ Koa] ( https://koajs.com/ ) - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/koa/ngrok-koa.js )
87
- * [ Nest.js] ( https://nestjs.com/ ) - [ Example main.ts] ( https://github.com/ngrok/ngrok-js /blob/main/examples/nestjs/src/main.ts )
88
- * [ Next.js] ( https://nextjs.org/ ) - [ Example next.config.js] ( https://github.com/ngrok/ngrok-js /blob/main/examples/nextjs/next.config.js ) loading [ ngrok.config.js] ( https://github.com/ngrok/ngrok-js /blob/main/examples/nextjs/ngrok.config.js )
89
- * [ Remix] ( https://remix.run/ ) - [ Example remix.config.js] ( https://github.com/ngrok/ngrok-js /blob/main/examples/remix/remix.config.js ) loading [ ngrok.config.js] ( https://github.com/ngrok/ngrok-js /blob/main/examples/remix/ngrok.config.js )
90
- * [ Svelte] ( https://svelte.dev/ ) - [ Example svelte.config.js] ( https://github.com/ngrok/ngrok-js /blob/main/examples/svelte/svelte.config.js ) (works in vite.config.js too) loading [ ngrok.config.cjs] ( https://github.com/ngrok/ngrok-js /blob/main/examples/svelte/ngrok.config.cjs )
91
- * [ Typescript] ( https://www.typescriptlang.org/ ) - [ Example ts-node] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-typescript.ts )
92
- * [ Vue] ( https://vuejs.org/ ) - [ Example vite.config.ts] ( https://github.com/ngrok/ngrok-js /blob/main/examples/vue/vite.config.ts ) loading [ ngrok.config.ts] ( https://github.com/ngrok/ngrok-js /blob/main/examples/vue/ngrok.config.ts )
93
- * [ Winston] ( https://github.com/winstonjs/winston#readme ) Logging - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-winston.js )
83
+ * [ Express] ( https://expressjs.com/ ) - [ Quickstart Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/express/ngrok-express-quickstart.js ) , [ Configuration Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/express/ngrok-express.js )
84
+ * [ Fastify] ( https://www.fastify.io/ ) - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/fastify/ngrok-fastify.js )
85
+ * [ Hapi] ( https://hapi.dev/ ) - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/hapi/ngrok-hapi.js )
86
+ * [ Koa] ( https://koajs.com/ ) - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/koa/ngrok-koa.js )
87
+ * [ Nest.js] ( https://nestjs.com/ ) - [ Example main.ts] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/nestjs/src/main.ts )
88
+ * [ Next.js] ( https://nextjs.org/ ) - [ Example next.config.js] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/nextjs/next.config.js ) loading [ ngrok.config.js] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/nextjs/ngrok.config.js )
89
+ * [ Remix] ( https://remix.run/ ) - [ Example remix.config.js] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/remix/remix.config.js ) loading [ ngrok.config.js] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/remix/ngrok.config.js )
90
+ * [ Svelte] ( https://svelte.dev/ ) - [ Example svelte.config.js] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/svelte/svelte.config.js ) (works in vite.config.js too) loading [ ngrok.config.cjs] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/svelte/ngrok.config.cjs )
91
+ * [ Typescript] ( https://www.typescriptlang.org/ ) - [ Example ts-node] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-typescript.ts )
92
+ * [ Vue] ( https://vuejs.org/ ) - [ Example vite.config.ts] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/vue/vite.config.ts ) loading [ ngrok.config.ts] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/vue/ngrok.config.ts )
93
+ * [ Winston] ( https://github.com/winstonjs/winston#readme ) Logging - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-winston.js )
94
94
95
95
## Tunnel Types
96
- * ngrok.connect - [ ngrok.connect Minimal Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-connect-minimal.js ) , [ Full ngrok.connect Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-connect-full.js )
97
- * HTTP - [ ngrok.listen Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-listen.js ) , [ Minimal Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-http-minimum.js ) , [ Full Configuration Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-http-full.js )
98
- * Labeled - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-labeled.js )
99
- * TCP - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-tcp.js )
100
- * TLS - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-tls.js )
101
- * Windows Pipe - [ Example] ( https://github.com/ngrok/ngrok-js /blob/main/examples/ngrok-windows-pipe.js )
96
+ * ngrok.connect - [ ngrok.connect Minimal Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-connect-minimal.js ) , [ Full ngrok.connect Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-connect-full.js )
97
+ * HTTP - [ ngrok.listen Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-listen.js ) , [ Minimal Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-http-minimum.js ) , [ Full Configuration Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-http-full.js )
98
+ * Labeled - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-labeled.js )
99
+ * TCP - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-tcp.js )
100
+ * TLS - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-tls.js )
101
+ * Windows Pipe - [ Example] ( https://github.com/ngrok/ngrok-nodejs /blob/main/examples/ngrok-windows-pipe.js )
102
102
103
103
# Async Programming
104
104
@@ -135,7 +135,7 @@ Pre-built binaries are provided on NPM for the following platforms:
135
135
| FreeBSD | | ✓ | | |
136
136
| Android | | | ✓ | ✓ |
137
137
138
- ngrok-js , and [ ngrok-rs ] ( https://github.com/ngrok/ngrok-rs / ) which it depends on, are open source, so it may be possible to build them for other platforms.
138
+ ngrok-nodejs , and [ ngrok-rust ] ( https://github.com/ngrok/ngrok-rust / ) which it depends on, are open source, so it may be possible to build them for other platforms.
139
139
140
140
* Windows-aarch64 will be supported after the next release of [ Ring] ( https://github.com/briansmith/ring/issues/1167 ) .
141
141
0 commit comments