@ngrok/ngrok 1.1.0 → 1.1.1
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 +4 -0
- package/README.md +1 -1
- package/index.d.ts +2 -0
- package/index.js +22 -19
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 1.1.1:
|
|
2
|
+
|
|
3
|
+
- Add `appProtocol(string)` to the labeled listener builder. Setting this to "http2" will enable HTTP/2 support to the backend application.
|
|
4
|
+
|
|
1
5
|
## 1.1.0:
|
|
2
6
|
|
|
3
7
|
- Add `appProtocol(string)` to http listener builder, and `app_protocol: string` as a `ngrok.forward()` argument. Setting this to "http2" will enable HTTP/2 support to the backend application.
|
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ A quickstart guide and a full API reference are included in the [ngrok-javascrip
|
|
|
69
69
|
|
|
70
70
|
### Authorization
|
|
71
71
|
|
|
72
|
-
To use
|
|
72
|
+
To use ngrok you'll need an authtoken. To obtain one, sign up for free at [ngrok.com](https://dashboard.ngrok.com/signup) and retrieve it from the [authtoken page of your ngrok dashboard](https://dashboard.ngrok.com/get-started/your-authtoken). Once you have copied your authtoken, you can reference it in several ways.
|
|
73
73
|
|
|
74
74
|
You can set it in the `NGROK_AUTHTOKEN` environment variable and pass `authtoken_from_env: true` to the [forward](https://ngrok.github.io/ngrok-javascript/functions/forward.html) method:
|
|
75
75
|
|
package/index.d.ts
CHANGED
|
@@ -704,6 +704,8 @@ export class LabeledListenerBuilder {
|
|
|
704
704
|
* [Using Labels]: https://ngrok.com/docs/guides/using-labels-within-ngrok/
|
|
705
705
|
*/
|
|
706
706
|
label(label: string, value: string): this
|
|
707
|
+
/** Set the L7 application portocol for this listener, i.e. "http1" or "http2" (defaults "http1") */
|
|
708
|
+
appProtocol(appProtocol: string): this
|
|
707
709
|
}
|
|
708
710
|
/**
|
|
709
711
|
* The builder for an ngrok session.
|
package/index.js
CHANGED
|
@@ -501,28 +501,31 @@ async function ngrokLinkPipe(listener, server) {
|
|
|
501
501
|
}
|
|
502
502
|
|
|
503
503
|
// protect against multiple calls, for instance from npm
|
|
504
|
-
var
|
|
504
|
+
var sigHandlerRan = false;
|
|
505
505
|
|
|
506
506
|
function registerCleanup(listener, socket) {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
507
|
+
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
508
|
+
process.on(signal, function () {
|
|
509
|
+
if (process.listenerCount(signal) > 1) {
|
|
510
|
+
// user has registered a handler, abort this one
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
510
513
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
}
|
|
514
|
+
if (sigHandlerRan) return;
|
|
515
|
+
sigHandlerRan = true;
|
|
516
|
+
|
|
517
|
+
// close listener
|
|
518
|
+
if (listener) {
|
|
519
|
+
listener.close().catch((err) => {
|
|
520
|
+
console.error(`Error closing listener: ${err}`);
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
// close webserver's socket
|
|
524
|
+
if (socket) socket.close();
|
|
525
|
+
// unregister any logging callback
|
|
526
|
+
loggingCallback();
|
|
527
|
+
});
|
|
528
|
+
}
|
|
526
529
|
}
|
|
527
530
|
|
|
528
531
|
function consoleLog(level) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/ngrok",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -76,18 +76,18 @@
|
|
|
76
76
|
"url": "https://github.com/ngrok/ngrok-javascript.git"
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
|
-
"@ngrok/ngrok-win32-x64-msvc": "1.1.
|
|
80
|
-
"@ngrok/ngrok-darwin-x64": "1.1.
|
|
81
|
-
"@ngrok/ngrok-linux-x64-gnu": "1.1.
|
|
82
|
-
"@ngrok/ngrok-darwin-arm64": "1.1.
|
|
83
|
-
"@ngrok/ngrok-android-arm64": "1.1.
|
|
84
|
-
"@ngrok/ngrok-linux-arm64-gnu": "1.1.
|
|
85
|
-
"@ngrok/ngrok-linux-arm64-musl": "1.1.
|
|
86
|
-
"@ngrok/ngrok-linux-arm-gnueabihf": "1.1.
|
|
87
|
-
"@ngrok/ngrok-linux-x64-musl": "1.1.
|
|
88
|
-
"@ngrok/ngrok-freebsd-x64": "1.1.
|
|
89
|
-
"@ngrok/ngrok-win32-ia32-msvc": "1.1.
|
|
90
|
-
"@ngrok/ngrok-android-arm-eabi": "1.1.
|
|
91
|
-
"@ngrok/ngrok-darwin-universal": "1.1.
|
|
79
|
+
"@ngrok/ngrok-win32-x64-msvc": "1.1.1",
|
|
80
|
+
"@ngrok/ngrok-darwin-x64": "1.1.1",
|
|
81
|
+
"@ngrok/ngrok-linux-x64-gnu": "1.1.1",
|
|
82
|
+
"@ngrok/ngrok-darwin-arm64": "1.1.1",
|
|
83
|
+
"@ngrok/ngrok-android-arm64": "1.1.1",
|
|
84
|
+
"@ngrok/ngrok-linux-arm64-gnu": "1.1.1",
|
|
85
|
+
"@ngrok/ngrok-linux-arm64-musl": "1.1.1",
|
|
86
|
+
"@ngrok/ngrok-linux-arm-gnueabihf": "1.1.1",
|
|
87
|
+
"@ngrok/ngrok-linux-x64-musl": "1.1.1",
|
|
88
|
+
"@ngrok/ngrok-freebsd-x64": "1.1.1",
|
|
89
|
+
"@ngrok/ngrok-win32-ia32-msvc": "1.1.1",
|
|
90
|
+
"@ngrok/ngrok-android-arm-eabi": "1.1.1",
|
|
91
|
+
"@ngrok/ngrok-darwin-universal": "1.1.1"
|
|
92
92
|
}
|
|
93
93
|
}
|