@ngrok/ngrok 0.7.1 → 0.9.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +19 -10
  2. package/Cargo.toml +2 -2
  3. package/README.md +48 -32
  4. package/RELEASE.md +1 -1
  5. package/docs/assets/highlight.css +19 -12
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/HttpListenerBuilder.html +594 -0
  8. package/docs/classes/LabeledListenerBuilder.html +206 -0
  9. package/docs/classes/Listener.html +241 -0
  10. package/docs/classes/Session.html +207 -0
  11. package/docs/classes/SessionBuilder.html +465 -0
  12. package/docs/classes/TcpListenerBuilder.html +281 -0
  13. package/docs/classes/TlsListenerBuilder.html +322 -0
  14. package/docs/classes/UpdateRequest.html +46 -43
  15. package/docs/functions/authtoken.html +30 -29
  16. package/docs/functions/connect.html +31 -30
  17. package/docs/functions/consoleLog.html +30 -29
  18. package/docs/functions/disconnect.html +31 -30
  19. package/docs/functions/getListener.html +89 -0
  20. package/docs/functions/getListenerByUrl.html +89 -0
  21. package/docs/functions/kill.html +31 -30
  22. package/docs/functions/listen.html +33 -32
  23. package/docs/functions/listenable.html +31 -30
  24. package/docs/functions/listeners.html +84 -0
  25. package/docs/functions/loggingCallback.html +30 -29
  26. package/docs/index.html +66 -58
  27. package/docs/interfaces/Config.html +445 -319
  28. package/docs/modules.html +48 -48
  29. package/examples/express/ngrok-express-quickstart.js +1 -1
  30. package/examples/express/ngrok-express.js +6 -6
  31. package/examples/fastify/ngrok-fastify.js +4 -4
  32. package/examples/hapi/ngrok-hapi.js +4 -4
  33. package/examples/koa/ngrok-koa.js +1 -1
  34. package/examples/nestjs/src/main.ts +5 -5
  35. package/examples/nextjs/README.md +3 -0
  36. package/examples/nextjs/ngrok.config.js +7 -7
  37. package/examples/ngrok-connect-full.js +8 -4
  38. package/examples/ngrok-connect-minimal.js +2 -2
  39. package/examples/ngrok-http-full.js +9 -6
  40. package/examples/ngrok-http-minimum.js +6 -6
  41. package/examples/ngrok-labeled.js +6 -6
  42. package/examples/ngrok-listen.js +1 -1
  43. package/examples/ngrok-tcp.js +5 -5
  44. package/examples/ngrok-tls.js +5 -5
  45. package/examples/ngrok-typescript.ts +12 -12
  46. package/examples/ngrok-windows-pipe.js +4 -4
  47. package/examples/ngrok-winston.js +2 -2
  48. package/examples/remix/ngrok.config.js +4 -4
  49. package/examples/svelte/ngrok.config.cjs +4 -4
  50. package/examples/vue/ngrok.config.ts +4 -4
  51. package/index.d.ts +511 -266
  52. package/index.js +75 -73
  53. package/package.json +14 -14
  54. package/scripts/gc-node-drop.js +7 -7
  55. package/scripts/gc-rust-drop.js +9 -9
  56. package/src/config.rs +113 -10
  57. package/src/connect.rs +38 -32
  58. package/src/http.rs +89 -23
  59. package/src/lib.rs +2 -2
  60. package/src/{tunnel.rs → listener.rs} +134 -134
  61. package/src/{tunnel_builder.rs → listener_builder.rs} +63 -54
  62. package/src/session.rs +57 -49
  63. package/src/tcp.rs +6 -3
  64. package/src/tls.rs +17 -7
  65. package/trailer.d.ts +5 -5
  66. package/trailer.js +64 -62
  67. package/typedoc.json +1 -1
  68. package/docs/classes/NgrokHttpTunnelBuilder.html +0 -510
  69. package/docs/classes/NgrokLabeledTunnelBuilder.html +0 -199
  70. package/docs/classes/NgrokSession.html +0 -199
  71. package/docs/classes/NgrokSessionBuilder.html +0 -449
  72. package/docs/classes/NgrokTcpTunnelBuilder.html +0 -268
  73. package/docs/classes/NgrokTlsTunnelBuilder.html +0 -304
  74. package/docs/classes/NgrokTunnel.html +0 -231
  75. package/docs/functions/getTunnel.html +0 -88
  76. package/docs/functions/getTunnelByUrl.html +0 -88
  77. package/docs/functions/tunnels.html +0 -83
@@ -13,12 +13,12 @@ ngrok.loggingCallback(function (level, target, message) {
13
13
  logger.log(level, message, { target: target });
14
14
  }, "TRACE");
15
15
 
16
- // set up tunnel
16
+ // set up listener
17
17
  const server = require("http").createServer(function (req, res) {
18
18
  res.writeHead(200);
19
19
  res.write("Hello");
20
20
  res.end();
21
21
  });
22
22
  ngrok.listen(server).then((socket) => {
23
- logger.info("Ingress established at:", socket.tunnel.url());
23
+ logger.info("Ingress established at:", socket.listener.url());
24
24
  });
@@ -7,10 +7,10 @@ process.argv.forEach((item, index) => {
7
7
  });
8
8
 
9
9
  async function setup() {
10
- const session = await new ngrok.NgrokSessionBuilder().authtokenFromEnv().connect();
11
- const tunnel = await session.httpEndpoint().listen();
12
- console.log(`Forwarding to: localhost:${port} from ingress at: ${tunnel.url()}`);
13
- tunnel.forward(`localhost:${port}`);
10
+ const session = await new ngrok.SessionBuilder().authtokenFromEnv().connect();
11
+ const listener = await session.httpEndpoint().listen();
12
+ console.log(`Forwarding to: localhost:${port} from ingress at: ${listener.url()}`);
13
+ listener.forward(`localhost:${port}`);
14
14
  }
15
15
 
16
16
  setup();
@@ -11,10 +11,10 @@ process.argv.forEach((item, index) => {
11
11
  });
12
12
 
13
13
  async function setup() {
14
- const session = await new ngrok.NgrokSessionBuilder().authtokenFromEnv().connect();
15
- const tunnel = await session.httpEndpoint().listen();
16
- console.log(`Forwarding to: ${host}:${port} from ingress at: ${tunnel.url()}`);
17
- tunnel.forward(`${host}:${port}`);
14
+ const session = await new ngrok.SessionBuilder().authtokenFromEnv().connect();
15
+ const listener = await session.httpEndpoint().listen();
16
+ console.log(`Forwarding to: ${host}:${port} from ingress at: ${listener.url()}`);
17
+ listener.forward(`${host}:${port}`);
18
18
  }
19
19
 
20
20
  if (run) setup();
@@ -9,10 +9,10 @@ process.argv.forEach((item, index) => {
9
9
  });
10
10
 
11
11
  async function setup() {
12
- const session = await new ngrok.NgrokSessionBuilder().authtokenFromEnv().connect();
13
- const tunnel = await session.httpEndpoint().listen();
14
- console.log(`Forwarding to: ${host}:${port} from ingress at: ${tunnel.url()}`);
15
- tunnel.forward(`${host}:${port}`);
12
+ const session = await new ngrok.SessionBuilder().authtokenFromEnv().connect();
13
+ const listener = await session.httpEndpoint().listen();
14
+ console.log(`Forwarding to: ${host}:${port} from ingress at: ${listener.url()}`);
15
+ listener.forward(`${host}:${port}`);
16
16
  }
17
17
 
18
18
  setup();