@ngrok/ngrok 0.7.0 → 0.7.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,7 @@
1
+ ## 0.7.1:
2
+
3
+ - Fix for windows pipe pathing.
4
+
1
5
  ## 0.7.0:
2
6
 
3
7
  - Add `listen_and_forward` and `listen_and_serve` to tunnel builders.
package/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  edition = "2021"
3
3
  name = "ngrok-nodejs"
4
- version = "0.7.0"
4
+ version = "0.7.1"
5
5
 
6
6
  [lib]
7
7
  crate-type = ["cdylib"]
@@ -22,7 +22,7 @@ ngrok.consoleLog("INFO"); // turn on info logging
22
22
  (async function () {
23
23
  const url = await ngrok.connect({
24
24
  // session configuration
25
- addr: `pipe:${UNIX_SOCKET}`,
25
+ addr: `unix:${UNIX_SOCKET}`,
26
26
  // addr: `localhost:8080`,
27
27
  // authtoken: "<authtoken>",
28
28
  authtoken_from_env: true,
@@ -35,7 +35,7 @@ builder.connect().then((session) => {
35
35
 
36
36
  /*
37
37
  ngrok.connect({
38
- addr: "pipe:" + UNIX_SOCKET,
38
+ addr: "unix:" + UNIX_SOCKET,
39
39
  authtoken_from_env: true,
40
40
  labels: "edge:edghts_<edge_id>",
41
41
  proto: "labeled",
package/index.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  export interface Config {
12
12
  /**
13
13
  * Port, network address, or named pipe. Defaults to 80.
14
- * Examples: "80", "localhost:8080", "pipe:/tmp/my.sock"
14
+ * Examples: "80", "localhost:8080", "unix:/tmp/my.sock", "pipe://./my-pipe"
15
15
  */
16
16
  addr?: number|string
17
17
  auth?: string|Array<string>
package/index.js CHANGED
@@ -17,7 +17,7 @@ function isMusl() {
17
17
  // For Node 10
18
18
  if (!process.report || typeof process.report.getReport !== 'function') {
19
19
  try {
20
- const lddPath = require('child_process').execSync('which ldd').toString().trim();
20
+ const lddPath = require('child_process').execSync('which ldd').toString().trim()
21
21
  return readFileSync(lddPath, 'utf8').includes('musl')
22
22
  } catch (e) {
23
23
  return true
@@ -488,8 +488,12 @@ async function ngrokLinkPipe(tunnel, server) {
488
488
  console.debug("Cannot change permissions of file: " + filename);
489
489
  }
490
490
  // forward tunnel
491
- const proto = platform == "win32" ? "pipe:" : "unix:";
492
- tunnel.forward(proto + filename);
491
+ var addr = "unix:" + filename;
492
+ if (platform == "win32") {
493
+ // convert pipe path to url
494
+ addr = "pipe:" + filename.replace("\\\\.\\pipe\\", "//./");
495
+ }
496
+ tunnel.forward(addr);
493
497
  socket.path = filename; // surface to caller
494
498
 
495
499
  return socket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/ngrok",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "napi": {
@@ -55,18 +55,18 @@
55
55
  "description": "The ngrok agent in library form, suitable for integrating directly into your NodeJS application.",
56
56
  "repository": "https://github.com/ngrok/ngrok-nodejs",
57
57
  "optionalDependencies": {
58
- "@ngrok/ngrok-win32-x64-msvc": "0.7.0",
59
- "@ngrok/ngrok-darwin-x64": "0.7.0",
60
- "@ngrok/ngrok-linux-x64-gnu": "0.7.0",
61
- "@ngrok/ngrok-darwin-arm64": "0.7.0",
62
- "@ngrok/ngrok-android-arm64": "0.7.0",
63
- "@ngrok/ngrok-linux-arm64-gnu": "0.7.0",
64
- "@ngrok/ngrok-linux-arm64-musl": "0.7.0",
65
- "@ngrok/ngrok-linux-arm-gnueabihf": "0.7.0",
66
- "@ngrok/ngrok-linux-x64-musl": "0.7.0",
67
- "@ngrok/ngrok-freebsd-x64": "0.7.0",
68
- "@ngrok/ngrok-win32-ia32-msvc": "0.7.0",
69
- "@ngrok/ngrok-android-arm-eabi": "0.7.0",
70
- "@ngrok/ngrok-darwin-universal": "0.7.0"
58
+ "@ngrok/ngrok-win32-x64-msvc": "0.7.1",
59
+ "@ngrok/ngrok-darwin-x64": "0.7.1",
60
+ "@ngrok/ngrok-linux-x64-gnu": "0.7.1",
61
+ "@ngrok/ngrok-darwin-arm64": "0.7.1",
62
+ "@ngrok/ngrok-android-arm64": "0.7.1",
63
+ "@ngrok/ngrok-linux-arm64-gnu": "0.7.1",
64
+ "@ngrok/ngrok-linux-arm64-musl": "0.7.1",
65
+ "@ngrok/ngrok-linux-arm-gnueabihf": "0.7.1",
66
+ "@ngrok/ngrok-linux-x64-musl": "0.7.1",
67
+ "@ngrok/ngrok-freebsd-x64": "0.7.1",
68
+ "@ngrok/ngrok-win32-ia32-msvc": "0.7.1",
69
+ "@ngrok/ngrok-android-arm-eabi": "0.7.1",
70
+ "@ngrok/ngrok-darwin-universal": "0.7.1"
71
71
  }
72
72
  }
package/src/config.rs CHANGED
@@ -7,7 +7,7 @@ use napi_derive::napi;
7
7
  #[derive(Default)]
8
8
  pub struct Config {
9
9
  /// Port, network address, or named pipe. Defaults to 80.
10
- /// Examples: "80", "localhost:8080", "pipe:/tmp/my.sock"
10
+ /// Examples: "80", "localhost:8080", "unix:/tmp/my.sock", "pipe://./my-pipe"
11
11
  #[napi(ts_type = "number|string")]
12
12
  pub addr: Option<String>,
13
13
  // Synonym for basic_auth
package/trailer.js CHANGED
@@ -216,8 +216,12 @@ async function ngrokLinkPipe(tunnel, server) {
216
216
  console.debug("Cannot change permissions of file: " + filename);
217
217
  }
218
218
  // forward tunnel
219
- const proto = platform == "win32" ? "pipe:" : "unix:";
220
- tunnel.forward(proto + filename);
219
+ var addr = "unix:" + filename;
220
+ if (platform == "win32") {
221
+ // convert pipe path to url
222
+ addr = "pipe:" + filename.replace("\\\\.\\pipe\\", "//./");
223
+ }
224
+ tunnel.forward(addr);
221
225
  socket.path = filename; // surface to caller
222
226
 
223
227
  return socket;