@ngrok/ngrok 0.9.1 → 1.1.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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.1.0:
2
+
3
+ - 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.
4
+
5
+ ## 1.0.0:
6
+
7
+ - Add policy support to Listener builders and `ngrok.forward`
8
+
1
9
  ## 0.9.1:
2
10
 
3
11
  - Move to `ngrok.forward` from `ngrok.connect`, keeping an alias.
package/README.md CHANGED
@@ -229,6 +229,8 @@ const listener = await ngrok.forward({
229
229
  proto: "http",
230
230
  proxy_proto: "", // One of: "", "1", "2"
231
231
  schemes: ["HTTPS"],
232
+ labels: "edge:edghts_2G...", // Along with proto="labeled"
233
+ app_protocol: "http2",
232
234
  // module configuration
233
235
  basic_auth: ["ngrok:online1line"],
234
236
  circuit_breaker: 0.1,
@@ -252,6 +254,7 @@ const listener = await ngrok.forward({
252
254
  oidc_allow_domains: ["<domain>"],
253
255
  oidc_allow_emails: ["<email>"],
254
256
  oidc_scopes: ["<scope>"],
257
+ policy: "<policy_json>",
255
258
  request_header_remove: ["X-Req-Nope"],
256
259
  response_header_remove: ["X-Res-Nope"],
257
260
  request_header_add: ["X-Req-Yup:true"],
package/index.d.ts CHANGED
@@ -14,6 +14,8 @@ export interface Config {
14
14
  * Examples: "80", "localhost:8080", "https://192.168.1.100:8443", "unix:/tmp/my.sock", "pipe://./my-pipe"
15
15
  */
16
16
  addr?: number|string
17
+ /** The L7 application protocol to use for this edge, e.g. "http2" or "http1". */
18
+ app_protocol?: string
17
19
  auth?: string|Array<string>
18
20
  /**
19
21
  * Configures the session to authenticate with the provided authtoken. You
@@ -217,6 +219,8 @@ export interface Config {
217
219
  onLogEvent?: (data: string) => void
218
220
  /** 'closed' - connection is lost, 'connected' - reconnected */
219
221
  onStatusChange?: (status: string) => void
222
+ /** The Traffic Policy to use for this endpoint. */
223
+ policy?: string
220
224
  /**
221
225
  * The port for the listener to forward to.
222
226
  * Only used if addr is not defined.
@@ -394,6 +398,8 @@ export class HttpListenerBuilder {
394
398
  * "HTTPS" or "HTTP", defaults to "HTTPS".
395
399
  */
396
400
  scheme(scheme: string): this
401
+ /** The L7 application protocol to use for this edge, e.g. "http2" or "http1". */
402
+ appProtocol(appProtocol: string): this
397
403
  /**
398
404
  * The domain to request for this edge, any valid domain or hostname that you have
399
405
  * previously registered with ngrok. If using a custom domain, this requires
@@ -542,6 +548,7 @@ export class HttpListenerBuilder {
542
548
  * set this `forwardsTo` value.
543
549
  */
544
550
  forwardsTo(forwardsTo: string): this
551
+ policy(policy: string): this
545
552
  }
546
553
  /**
547
554
  *r" An ngrok listener backing a TCP endpoint.
@@ -590,6 +597,7 @@ export class TcpListenerBuilder {
590
597
  * set this `forwardsTo` value.
591
598
  */
592
599
  forwardsTo(forwardsTo: string): this
600
+ policy(policy: string): this
593
601
  /**
594
602
  * The TCP address to request for this edge.
595
603
  * These addresses can be reserved in the [ngrok dashboard] to use across sessions. For example: remote_addr("2.tcp.ngrok.io:21746")
@@ -645,6 +653,7 @@ export class TlsListenerBuilder {
645
653
  * set this `forwardsTo` value.
646
654
  */
647
655
  forwardsTo(forwardsTo: string): this
656
+ policy(policy: string): this
648
657
  /**
649
658
  * The domain to request for this edge, any valid domain or hostname that you have
650
659
  * 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": "0.9.1",
3
+ "version": "1.1.0",
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": "0.9.1",
80
- "@ngrok/ngrok-darwin-x64": "0.9.1",
81
- "@ngrok/ngrok-linux-x64-gnu": "0.9.1",
82
- "@ngrok/ngrok-darwin-arm64": "0.9.1",
83
- "@ngrok/ngrok-android-arm64": "0.9.1",
84
- "@ngrok/ngrok-linux-arm64-gnu": "0.9.1",
85
- "@ngrok/ngrok-linux-arm64-musl": "0.9.1",
86
- "@ngrok/ngrok-linux-arm-gnueabihf": "0.9.1",
87
- "@ngrok/ngrok-linux-x64-musl": "0.9.1",
88
- "@ngrok/ngrok-freebsd-x64": "0.9.1",
89
- "@ngrok/ngrok-win32-ia32-msvc": "0.9.1",
90
- "@ngrok/ngrok-android-arm-eabi": "0.9.1",
91
- "@ngrok/ngrok-darwin-universal": "0.9.1"
79
+ "@ngrok/ngrok-win32-x64-msvc": "1.1.0",
80
+ "@ngrok/ngrok-darwin-x64": "1.1.0",
81
+ "@ngrok/ngrok-linux-x64-gnu": "1.1.0",
82
+ "@ngrok/ngrok-darwin-arm64": "1.1.0",
83
+ "@ngrok/ngrok-android-arm64": "1.1.0",
84
+ "@ngrok/ngrok-linux-arm64-gnu": "1.1.0",
85
+ "@ngrok/ngrok-linux-arm64-musl": "1.1.0",
86
+ "@ngrok/ngrok-linux-arm-gnueabihf": "1.1.0",
87
+ "@ngrok/ngrok-linux-x64-musl": "1.1.0",
88
+ "@ngrok/ngrok-freebsd-x64": "1.1.0",
89
+ "@ngrok/ngrok-win32-ia32-msvc": "1.1.0",
90
+ "@ngrok/ngrok-android-arm-eabi": "1.1.0",
91
+ "@ngrok/ngrok-darwin-universal": "1.1.0"
92
92
  }
93
93
  }