@ngrok/ngrok 1.3.0 → 1.4.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 CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.4.1
2
+
3
+ - Fix `traffic_policy` naming for `ngrok.forward`
4
+
5
+ ## 1.4.0
6
+
7
+ - Rename `policy` to `traffic_policy`
8
+ - Fix quickstart example in README
9
+ - Add Microsoft Visual C++ Redistributable requirement for Windows to documentation
10
+
1
11
  ## 1.3.0:
2
12
 
3
13
  - Add `rootCas` to session builder and `root_cas` to `ngrok.forward`. Setting this to `host` will use the host's trusted certificates to connect for the ngrok session.
package/README.md CHANGED
@@ -56,6 +56,8 @@ pnpm add @ngrok/ngrok
56
56
  // Output ngrok url to console
57
57
  console.log(`Ingress established at: ${listener.url()}`);
58
58
  })();
59
+
60
+ process.stdin.resume();
59
61
  ```
60
62
 
61
63
  That's it! Your application should now be available through the url output in your terminal.
@@ -258,7 +260,7 @@ const listener = await ngrok.forward({
258
260
  oidc_allow_domains: ["<domain>"],
259
261
  oidc_allow_emails: ["<email>"],
260
262
  oidc_scopes: ["<scope>"],
261
- policy: "<policy_json>",
263
+ traffic_policy: "<policy_json>",
262
264
  request_header_remove: ["X-Req-Nope"],
263
265
  response_header_remove: ["X-Res-Nope"],
264
266
  request_header_add: ["X-Req-Yup:true"],
@@ -325,6 +327,8 @@ Pre-built binaries are provided on NPM for the following platforms:
325
327
 
326
328
  > **Note**
327
329
  > `ngrok-javascript`, 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.
330
+ >
331
+ > On Windows, ensure you have [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version) installed.
328
332
  > * `Windows-aarch64` will be supported after the next release of [Ring](https://github.com/briansmith/ring/issues/1167).
329
333
 
330
334
  # Dependencies
package/index.d.ts CHANGED
@@ -221,7 +221,7 @@ export interface Config {
221
221
  onLogEvent?: (data: string) => void
222
222
  /** 'closed' - connection is lost, 'connected' - reconnected */
223
223
  onStatusChange?: (status: string) => void
224
- /** The Traffic Policy to use for this endpoint. */
224
+ /** DEPRECATED: use TrafficPolicy instead. */
225
225
  policy?: string
226
226
  /**
227
227
  * The port for the listener to forward to.
@@ -323,6 +323,8 @@ export interface Config {
323
323
  subdomain?: string
324
324
  /** Unused, will warn and be ignored */
325
325
  terminate_at?: string
326
+ /** The Traffic Policy to use for this endpoint. */
327
+ traffic_policy?: string
326
328
  /** Whether to disable certificate verification for this listener */
327
329
  verify_upstream_tls?: boolean
328
330
  /**
@@ -349,7 +351,7 @@ export interface Config {
349
351
  *
350
352
  * See {@link forward} for the full set of options.
351
353
  */
352
- export function connect(config: Config|string|number): Promise<Listener>
354
+ export declare function connect(config: Config|string|number): Promise<Listener>
353
355
  /**
354
356
  * Transform a json object configuration into a listener.
355
357
  * See {@link Config} for the full set of options.
@@ -359,25 +361,25 @@ export function connect(config: Config|string|number): Promise<Listener>
359
361
  * listener = await ngrok.forward({addr: "https://localhost:8443", authtoken_from_env: true});<br>
360
362
  * listener = await ngrok.forward({addr: "unix:///path/to/unix.socket", basic_auth: "ngrok:online1line", authtoken_from_env: true});
361
363
  */
362
- export function forward(config: Config|string|number): Promise<Listener>
364
+ export declare function forward(config: Config|string|number): Promise<Listener>
363
365
  /** Close a listener with the given url, or all listeners if no url is defined. */
364
- export function disconnect(url?: string | undefined | null): Promise<void>
366
+ export declare function disconnect(url?: string | undefined | null): Promise<void>
365
367
  /** Close all listeners. */
366
- export function kill(): Promise<void>
368
+ export declare function kill(): Promise<void>
367
369
  /** Retrieve a list of non-closed listeners, in no particular order. */
368
- export function listeners(): Promise<Array<Listener>>
370
+ export declare function listeners(): Promise<Array<Listener>>
369
371
  /** Retrieve listener using the id */
370
- export function getListener(id: string): Promise<Listener | null>
372
+ export declare function getListener(id: string): Promise<Listener | null>
371
373
  /** Retrieve listener using the url */
372
- export function getListenerByUrl(url: string): Promise<Listener | null>
374
+ export declare function getListenerByUrl(url: string): Promise<Listener | null>
373
375
  /**
374
376
  * Register a callback function that will receive logging event information.
375
377
  * An absent callback will unregister an existing callback function.
376
378
  * The log level defaults to INFO, it can be set to one of ERROR, WARN, INFO, DEBUG, or TRACE.
377
379
  */
378
- export function loggingCallback(callback?: (level: string, target: string, message: string) => void, level?: string): void
380
+ export declare function loggingCallback(callback?: (level: string, target: string, message: string) => void, level?: string): void
379
381
  /** Set the default auth token to use for any future sessions. */
380
- export function authtoken(authtoken: string): Promise<void>
382
+ export declare function authtoken(authtoken: string): Promise<void>
381
383
  /**
382
384
  * An ngrok listener.
383
385
  *
@@ -587,6 +589,7 @@ export class HttpListenerBuilder {
587
589
  */
588
590
  forwardsTo(forwardsTo: string): this
589
591
  policy(policy: string): this
592
+ trafficPolicy(trafficPolicy: string): this
590
593
  }
591
594
  /**
592
595
  *r" An ngrok listener backing a TCP endpoint.
@@ -638,6 +641,7 @@ export class TcpListenerBuilder {
638
641
  */
639
642
  forwardsTo(forwardsTo: string): this
640
643
  policy(policy: string): this
644
+ trafficPolicy(trafficPolicy: string): this
641
645
  /**
642
646
  * The TCP address to request for this edge.
643
647
  * These addresses can be reserved in the [ngrok dashboard] to use across sessions. For example: remote_addr("2.tcp.ngrok.io:21746")
@@ -696,6 +700,7 @@ export class TlsListenerBuilder {
696
700
  */
697
701
  forwardsTo(forwardsTo: string): this
698
702
  policy(policy: string): this
703
+ trafficPolicy(trafficPolicy: string): this
699
704
  /**
700
705
  * The domain to request for this edge, any valid domain or hostname that you have
701
706
  * previously registered with ngrok. If using a custom domain, this requires
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/ngrok",
3
- "version": "1.3.0",
3
+ "version": "1.4.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.3.0",
80
- "@ngrok/ngrok-darwin-x64": "1.3.0",
81
- "@ngrok/ngrok-linux-x64-gnu": "1.3.0",
82
- "@ngrok/ngrok-darwin-arm64": "1.3.0",
83
- "@ngrok/ngrok-android-arm64": "1.3.0",
84
- "@ngrok/ngrok-linux-arm64-gnu": "1.3.0",
85
- "@ngrok/ngrok-linux-arm64-musl": "1.3.0",
86
- "@ngrok/ngrok-linux-arm-gnueabihf": "1.3.0",
87
- "@ngrok/ngrok-linux-x64-musl": "1.3.0",
88
- "@ngrok/ngrok-freebsd-x64": "1.3.0",
89
- "@ngrok/ngrok-win32-ia32-msvc": "1.3.0",
90
- "@ngrok/ngrok-android-arm-eabi": "1.3.0",
91
- "@ngrok/ngrok-darwin-universal": "1.3.0"
79
+ "@ngrok/ngrok-win32-x64-msvc": "1.4.1",
80
+ "@ngrok/ngrok-darwin-x64": "1.4.1",
81
+ "@ngrok/ngrok-linux-x64-gnu": "1.4.1",
82
+ "@ngrok/ngrok-darwin-arm64": "1.4.1",
83
+ "@ngrok/ngrok-android-arm64": "1.4.1",
84
+ "@ngrok/ngrok-linux-arm64-gnu": "1.4.1",
85
+ "@ngrok/ngrok-linux-arm64-musl": "1.4.1",
86
+ "@ngrok/ngrok-linux-arm-gnueabihf": "1.4.1",
87
+ "@ngrok/ngrok-linux-x64-musl": "1.4.1",
88
+ "@ngrok/ngrok-freebsd-x64": "1.4.1",
89
+ "@ngrok/ngrok-win32-ia32-msvc": "1.4.1",
90
+ "@ngrok/ngrok-android-arm-eabi": "1.4.1",
91
+ "@ngrok/ngrok-darwin-universal": "1.4.1"
92
92
  }
93
93
  }