@ngrok/ngrok 0.4.1 → 0.5.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 +7 -2
- package/CONTRIBUTING.md +4 -4
- package/Cargo.toml +3 -3
- package/README.md +29 -29
- package/docs/assets/search.js +1 -1
- package/docs/classes/NgrokHttpTunnelBuilder.html +21 -21
- package/docs/classes/NgrokLabeledTunnelBuilder.html +4 -4
- package/docs/classes/NgrokSession.html +7 -7
- package/docs/classes/NgrokSessionBuilder.html +40 -15
- package/docs/classes/NgrokTcpTunnelBuilder.html +8 -8
- package/docs/classes/NgrokTlsTunnelBuilder.html +10 -10
- package/docs/classes/NgrokTunnel.html +10 -10
- package/docs/classes/UpdateRequest.html +3 -3
- package/docs/functions/authtoken.html +1 -1
- package/docs/functions/connect.html +1 -1
- package/docs/functions/consoleLog.html +1 -1
- package/docs/functions/disconnect.html +1 -1
- package/docs/functions/kill.html +1 -1
- package/docs/functions/listen.html +1 -1
- package/docs/functions/listenable.html +1 -1
- package/docs/functions/loggingCallback.html +1 -1
- package/docs/index.html +28 -28
- package/docs/interfaces/Config.html +53 -53
- package/examples/ngrok-http-full.js +1 -0
- package/flake.nix +1 -1
- package/index.d.ts +12 -0
- package/package.json +15 -15
- package/src/session.rs +27 -4
package/flake.nix
CHANGED
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
|
|
94
94
|
OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
|
|
95
95
|
shellHook = ''
|
|
96
|
-
export PATH="$PATH
|
|
96
|
+
export PATH="$PATH:$(git rev-parse --show-toplevel)/node_modules/.bin:$(git rev-parse --show-toplevel)/examples/node_modules/.bin"
|
|
97
97
|
'';
|
|
98
98
|
buildInputs = with pkgs; [
|
|
99
99
|
toolchain
|
package/index.d.ts
CHANGED
|
@@ -207,6 +207,18 @@ export class NgrokSessionBuilder {
|
|
|
207
207
|
* NGROK_AUTHTOKEN environment variable.
|
|
208
208
|
*/
|
|
209
209
|
authtokenFromEnv(): this
|
|
210
|
+
/**
|
|
211
|
+
* Add client type and version information for a client application.
|
|
212
|
+
*
|
|
213
|
+
* This is a way for applications and library consumers of this crate
|
|
214
|
+
* identify themselves.
|
|
215
|
+
*
|
|
216
|
+
* This will add a new entry to the `User-Agent` field in the "most significant"
|
|
217
|
+
* (first) position. Comments must follow [RFC 7230] or a connection error may occur.
|
|
218
|
+
*
|
|
219
|
+
* [RFC 7230]: https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6
|
|
220
|
+
*/
|
|
221
|
+
clientInfo(clientType: string, version: string, comments?: string | undefined | null): this
|
|
210
222
|
/**
|
|
211
223
|
* Configures how often the session will send heartbeat messages to the ngrok
|
|
212
224
|
* service to check session liveness.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/ngrok",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"napi": {
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
},
|
|
54
54
|
"packageManager": "yarn@3.3.1",
|
|
55
55
|
"description": "The ngrok agent in library form, suitable for integrating directly into your NodeJS application.",
|
|
56
|
-
"repository": "https://github.com/ngrok/ngrok-
|
|
56
|
+
"repository": "https://github.com/ngrok/ngrok-nodejs",
|
|
57
57
|
"optionalDependencies": {
|
|
58
|
-
"@ngrok/ngrok-win32-x64-msvc": "0.
|
|
59
|
-
"@ngrok/ngrok-darwin-x64": "0.
|
|
60
|
-
"@ngrok/ngrok-linux-x64-gnu": "0.
|
|
61
|
-
"@ngrok/ngrok-darwin-arm64": "0.
|
|
62
|
-
"@ngrok/ngrok-android-arm64": "0.
|
|
63
|
-
"@ngrok/ngrok-linux-arm64-gnu": "0.
|
|
64
|
-
"@ngrok/ngrok-linux-arm64-musl": "0.
|
|
65
|
-
"@ngrok/ngrok-linux-arm-gnueabihf": "0.
|
|
66
|
-
"@ngrok/ngrok-linux-x64-musl": "0.
|
|
67
|
-
"@ngrok/ngrok-freebsd-x64": "0.
|
|
68
|
-
"@ngrok/ngrok-win32-ia32-msvc": "0.
|
|
69
|
-
"@ngrok/ngrok-android-arm-eabi": "0.
|
|
70
|
-
"@ngrok/ngrok-darwin-universal": "0.
|
|
58
|
+
"@ngrok/ngrok-win32-x64-msvc": "0.5.0",
|
|
59
|
+
"@ngrok/ngrok-darwin-x64": "0.5.0",
|
|
60
|
+
"@ngrok/ngrok-linux-x64-gnu": "0.5.0",
|
|
61
|
+
"@ngrok/ngrok-darwin-arm64": "0.5.0",
|
|
62
|
+
"@ngrok/ngrok-android-arm64": "0.5.0",
|
|
63
|
+
"@ngrok/ngrok-linux-arm64-gnu": "0.5.0",
|
|
64
|
+
"@ngrok/ngrok-linux-arm64-musl": "0.5.0",
|
|
65
|
+
"@ngrok/ngrok-linux-arm-gnueabihf": "0.5.0",
|
|
66
|
+
"@ngrok/ngrok-linux-x64-musl": "0.5.0",
|
|
67
|
+
"@ngrok/ngrok-freebsd-x64": "0.5.0",
|
|
68
|
+
"@ngrok/ngrok-win32-ia32-msvc": "0.5.0",
|
|
69
|
+
"@ngrok/ngrok-android-arm-eabi": "0.5.0",
|
|
70
|
+
"@ngrok/ngrok-darwin-universal": "0.5.0"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/src/session.rs
CHANGED
|
@@ -44,7 +44,7 @@ use crate::{
|
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
const CLIENT_TYPE: &str = "
|
|
47
|
+
const CLIENT_TYPE: &str = "ngrok-nodejs";
|
|
48
48
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
49
49
|
|
|
50
50
|
// appease clippy
|
|
@@ -84,9 +84,11 @@ impl NgrokSessionBuilder {
|
|
|
84
84
|
#[napi(constructor)]
|
|
85
85
|
pub fn new() -> Self {
|
|
86
86
|
NgrokSessionBuilder {
|
|
87
|
-
raw_builder: Arc::new(SyncMutex::new(
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
raw_builder: Arc::new(SyncMutex::new(Session::builder().client_info(
|
|
88
|
+
CLIENT_TYPE,
|
|
89
|
+
VERSION,
|
|
90
|
+
None::<String>,
|
|
91
|
+
))),
|
|
90
92
|
..Default::default()
|
|
91
93
|
}
|
|
92
94
|
}
|
|
@@ -118,6 +120,27 @@ impl NgrokSessionBuilder {
|
|
|
118
120
|
self
|
|
119
121
|
}
|
|
120
122
|
|
|
123
|
+
/// Add client type and version information for a client application.
|
|
124
|
+
///
|
|
125
|
+
/// This is a way for applications and library consumers of this crate
|
|
126
|
+
/// identify themselves.
|
|
127
|
+
///
|
|
128
|
+
/// This will add a new entry to the `User-Agent` field in the "most significant"
|
|
129
|
+
/// (first) position. Comments must follow [RFC 7230] or a connection error may occur.
|
|
130
|
+
///
|
|
131
|
+
/// [RFC 7230]: https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6
|
|
132
|
+
#[napi]
|
|
133
|
+
pub fn client_info(
|
|
134
|
+
&mut self,
|
|
135
|
+
client_type: String,
|
|
136
|
+
version: String,
|
|
137
|
+
comments: Option<String>,
|
|
138
|
+
) -> &Self {
|
|
139
|
+
let mut builder = self.raw_builder.lock();
|
|
140
|
+
*builder = builder.clone().client_info(client_type, version, comments);
|
|
141
|
+
self
|
|
142
|
+
}
|
|
143
|
+
|
|
121
144
|
/// Configures how often the session will send heartbeat messages to the ngrok
|
|
122
145
|
/// service to check session liveness.
|
|
123
146
|
///
|