@ngrok/ngrok 0.9.0 → 1.0.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 (146) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/CONTRIBUTING.md +4 -4
  3. package/README.md +176 -142
  4. package/index.d.ts +75 -15
  5. package/index.js +8 -6
  6. package/package.json +37 -16
  7. package/.envrc +0 -1
  8. package/.gitattributes +0 -3
  9. package/.prettierrc.json +0 -3
  10. package/.yarnrc.yml +0 -3
  11. package/Cargo.toml +0 -34
  12. package/RELEASE.md +0 -26
  13. package/build.rs +0 -5
  14. package/docs/.nojekyll +0 -1
  15. package/docs/assets/highlight.css +0 -92
  16. package/docs/assets/main.js +0 -58
  17. package/docs/assets/search.js +0 -1
  18. package/docs/assets/style.css +0 -1367
  19. package/docs/classes/HttpListenerBuilder.html +0 -594
  20. package/docs/classes/LabeledListenerBuilder.html +0 -206
  21. package/docs/classes/Listener.html +0 -241
  22. package/docs/classes/Session.html +0 -207
  23. package/docs/classes/SessionBuilder.html +0 -465
  24. package/docs/classes/TcpListenerBuilder.html +0 -281
  25. package/docs/classes/TlsListenerBuilder.html +0 -322
  26. package/docs/classes/UpdateRequest.html +0 -131
  27. package/docs/functions/authtoken.html +0 -89
  28. package/docs/functions/connect.html +0 -89
  29. package/docs/functions/consoleLog.html +0 -90
  30. package/docs/functions/disconnect.html +0 -89
  31. package/docs/functions/getListener.html +0 -89
  32. package/docs/functions/getListenerByUrl.html +0 -89
  33. package/docs/functions/kill.html +0 -84
  34. package/docs/functions/listen.html +0 -92
  35. package/docs/functions/listenable.html +0 -85
  36. package/docs/functions/listeners.html +0 -84
  37. package/docs/functions/loggingCallback.html +0 -108
  38. package/docs/index.html +0 -292
  39. package/docs/interfaces/Config.html +0 -734
  40. package/docs/modules.html +0 -106
  41. package/examples/domain.crt +0 -18
  42. package/examples/domain.key +0 -27
  43. package/examples/express/ngrok-express-quickstart.js +0 -11
  44. package/examples/express/ngrok-express.js +0 -28
  45. package/examples/express/package.json +0 -7
  46. package/examples/fastify/ngrok-fastify.js +0 -26
  47. package/examples/fastify/package.json +0 -7
  48. package/examples/hapi/ngrok-hapi.js +0 -35
  49. package/examples/hapi/package.json +0 -7
  50. package/examples/koa/ngrok-koa.js +0 -12
  51. package/examples/koa/package.json +0 -7
  52. package/examples/nestjs/.eslintrc.js +0 -25
  53. package/examples/nestjs/.prettierrc +0 -4
  54. package/examples/nestjs/README.md +0 -73
  55. package/examples/nestjs/nest-cli.json +0 -8
  56. package/examples/nestjs/package.json +0 -70
  57. package/examples/nestjs/src/app.controller.spec.ts +0 -22
  58. package/examples/nestjs/src/app.controller.ts +0 -12
  59. package/examples/nestjs/src/app.module.ts +0 -10
  60. package/examples/nestjs/src/app.service.ts +0 -8
  61. package/examples/nestjs/src/main.ts +0 -17
  62. package/examples/nestjs/test/app.e2e-spec.ts +0 -24
  63. package/examples/nestjs/test/jest-e2e.json +0 -9
  64. package/examples/nestjs/tsconfig.build.json +0 -4
  65. package/examples/nestjs/tsconfig.json +0 -21
  66. package/examples/nextjs/README.md +0 -3
  67. package/examples/nextjs/next.config.js +0 -12
  68. package/examples/nextjs/ngrok.config.js +0 -23
  69. package/examples/nextjs/package.json +0 -6
  70. package/examples/nextjs/pages/index.js +0 -5
  71. package/examples/ngrok-connect-full.js +0 -67
  72. package/examples/ngrok-connect-minimal.js +0 -17
  73. package/examples/ngrok-http-full.js +0 -81
  74. package/examples/ngrok-http-minimum.js +0 -18
  75. package/examples/ngrok-labeled.js +0 -43
  76. package/examples/ngrok-listen.js +0 -11
  77. package/examples/ngrok-tcp.js +0 -37
  78. package/examples/ngrok-tls.js +0 -40
  79. package/examples/ngrok-typescript.ts +0 -69
  80. package/examples/ngrok-windows-pipe.js +0 -25
  81. package/examples/ngrok-winston.js +0 -24
  82. package/examples/package.json +0 -15
  83. package/examples/remix/.eslintrc.js +0 -4
  84. package/examples/remix/README.md +0 -53
  85. package/examples/remix/app/entry.client.tsx +0 -18
  86. package/examples/remix/app/entry.server.tsx +0 -101
  87. package/examples/remix/app/root.tsx +0 -20
  88. package/examples/remix/app/routes/_index.tsx +0 -30
  89. package/examples/remix/ngrok.config.js +0 -16
  90. package/examples/remix/package.json +0 -30
  91. package/examples/remix/public/favicon.ico +0 -0
  92. package/examples/remix/remix.config.js +0 -16
  93. package/examples/remix/remix.env.d.ts +0 -2
  94. package/examples/remix/tsconfig.json +0 -22
  95. package/examples/svelte/README.md +0 -38
  96. package/examples/svelte/jsconfig.json +0 -17
  97. package/examples/svelte/ngrok.config.cjs +0 -20
  98. package/examples/svelte/package.json +0 -22
  99. package/examples/svelte/src/app.d.ts +0 -12
  100. package/examples/svelte/src/app.html +0 -12
  101. package/examples/svelte/src/routes/+page.svelte +0 -2
  102. package/examples/svelte/static/favicon.png +0 -0
  103. package/examples/svelte/svelte.config.js +0 -14
  104. package/examples/svelte/vite.config.js +0 -6
  105. package/examples/vue/.vscode/extensions.json +0 -3
  106. package/examples/vue/README.md +0 -40
  107. package/examples/vue/env.d.ts +0 -1
  108. package/examples/vue/index.html +0 -13
  109. package/examples/vue/ngrok.config.ts +0 -18
  110. package/examples/vue/package.json +0 -25
  111. package/examples/vue/public/favicon.ico +0 -0
  112. package/examples/vue/src/App.vue +0 -47
  113. package/examples/vue/src/assets/base.css +0 -74
  114. package/examples/vue/src/assets/logo.svg +0 -1
  115. package/examples/vue/src/assets/main.css +0 -35
  116. package/examples/vue/src/components/HelloWorld.vue +0 -40
  117. package/examples/vue/src/components/TheWelcome.vue +0 -86
  118. package/examples/vue/src/components/WelcomeItem.vue +0 -86
  119. package/examples/vue/src/components/icons/IconCommunity.vue +0 -7
  120. package/examples/vue/src/components/icons/IconDocumentation.vue +0 -7
  121. package/examples/vue/src/components/icons/IconEcosystem.vue +0 -7
  122. package/examples/vue/src/components/icons/IconSupport.vue +0 -7
  123. package/examples/vue/src/components/icons/IconTooling.vue +0 -19
  124. package/examples/vue/src/main.ts +0 -6
  125. package/examples/vue/tsconfig.json +0 -16
  126. package/examples/vue/tsconfig.node.json +0 -8
  127. package/examples/vue/vite.config.ts +0 -15
  128. package/flake.lock +0 -82
  129. package/flake.nix +0 -111
  130. package/post-build.js +0 -45
  131. package/scripts/gc-node-drop.js +0 -49
  132. package/scripts/gc-rust-drop.js +0 -53
  133. package/src/config.rs +0 -285
  134. package/src/connect.rs +0 -342
  135. package/src/http.rs +0 -244
  136. package/src/lib.rs +0 -39
  137. package/src/listener.rs +0 -495
  138. package/src/listener_builder.rs +0 -204
  139. package/src/logging.rs +0 -140
  140. package/src/session.rs +0 -551
  141. package/src/tcp.rs +0 -18
  142. package/src/tls.rs +0 -44
  143. package/trailer.d.ts +0 -15
  144. package/trailer.js +0 -382
  145. package/tsconfig.json +0 -8
  146. package/typedoc.json +0 -3
@@ -1,35 +0,0 @@
1
- @import './base.css';
2
-
3
- #app {
4
- max-width: 1280px;
5
- margin: 0 auto;
6
- padding: 2rem;
7
-
8
- font-weight: normal;
9
- }
10
-
11
- a,
12
- .green {
13
- text-decoration: none;
14
- color: hsla(160, 100%, 37%, 1);
15
- transition: 0.4s;
16
- }
17
-
18
- @media (hover: hover) {
19
- a:hover {
20
- background-color: hsla(160, 100%, 37%, 0.2);
21
- }
22
- }
23
-
24
- @media (min-width: 1024px) {
25
- body {
26
- display: flex;
27
- place-items: center;
28
- }
29
-
30
- #app {
31
- display: grid;
32
- grid-template-columns: 1fr 1fr;
33
- padding: 0 2rem;
34
- }
35
- }
@@ -1,40 +0,0 @@
1
- <script setup lang="ts">
2
- defineProps<{
3
- msg: string
4
- }>()
5
- </script>
6
-
7
- <template>
8
- <div class="greetings">
9
- <h1 class="green">{{ msg }}</h1>
10
- <h3>
11
- You’ve successfully created a project with
12
- <a href="https://vitejs.dev/" target="_blank" rel="noopener">Vite</a> +
13
- <a href="https://vuejs.org/" target="_blank" rel="noopener">Vue 3</a>.
14
- </h3>
15
- </div>
16
- </template>
17
-
18
- <style scoped>
19
- h1 {
20
- font-weight: 500;
21
- font-size: 2.6rem;
22
- top: -10px;
23
- }
24
-
25
- h3 {
26
- font-size: 1.2rem;
27
- }
28
-
29
- .greetings h1,
30
- .greetings h3 {
31
- text-align: center;
32
- }
33
-
34
- @media (min-width: 1024px) {
35
- .greetings h1,
36
- .greetings h3 {
37
- text-align: left;
38
- }
39
- }
40
- </style>
@@ -1,86 +0,0 @@
1
- <script setup lang="ts">
2
- import WelcomeItem from './WelcomeItem.vue'
3
- import DocumentationIcon from './icons/IconDocumentation.vue'
4
- import ToolingIcon from './icons/IconTooling.vue'
5
- import EcosystemIcon from './icons/IconEcosystem.vue'
6
- import CommunityIcon from './icons/IconCommunity.vue'
7
- import SupportIcon from './icons/IconSupport.vue'
8
- </script>
9
-
10
- <template>
11
- <WelcomeItem>
12
- <template #icon>
13
- <DocumentationIcon />
14
- </template>
15
- <template #heading>Documentation</template>
16
-
17
- Vue’s
18
- <a href="https://vuejs.org/" target="_blank" rel="noopener">official documentation</a>
19
- provides you with all information you need to get started.
20
- </WelcomeItem>
21
-
22
- <WelcomeItem>
23
- <template #icon>
24
- <ToolingIcon />
25
- </template>
26
- <template #heading>Tooling</template>
27
-
28
- This project is served and bundled with
29
- <a href="https://vitejs.dev/guide/features.html" target="_blank" rel="noopener">Vite</a>. The
30
- recommended IDE setup is
31
- <a href="https://code.visualstudio.com/" target="_blank" rel="noopener">VSCode</a> +
32
- <a href="https://github.com/johnsoncodehk/volar" target="_blank" rel="noopener">Volar</a>. If
33
- you need to test your components and web pages, check out
34
- <a href="https://www.cypress.io/" target="_blank" rel="noopener">Cypress</a> and
35
- <a href="https://on.cypress.io/component" target="_blank">Cypress Component Testing</a>.
36
-
37
- <br />
38
-
39
- More instructions are available in <code>README.md</code>.
40
- </WelcomeItem>
41
-
42
- <WelcomeItem>
43
- <template #icon>
44
- <EcosystemIcon />
45
- </template>
46
- <template #heading>Ecosystem</template>
47
-
48
- Get official tools and libraries for your project:
49
- <a href="https://pinia.vuejs.org/" target="_blank" rel="noopener">Pinia</a>,
50
- <a href="https://router.vuejs.org/" target="_blank" rel="noopener">Vue Router</a>,
51
- <a href="https://test-utils.vuejs.org/" target="_blank" rel="noopener">Vue Test Utils</a>, and
52
- <a href="https://github.com/vuejs/devtools" target="_blank" rel="noopener">Vue Dev Tools</a>. If
53
- you need more resources, we suggest paying
54
- <a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">Awesome Vue</a>
55
- a visit.
56
- </WelcomeItem>
57
-
58
- <WelcomeItem>
59
- <template #icon>
60
- <CommunityIcon />
61
- </template>
62
- <template #heading>Community</template>
63
-
64
- Got stuck? Ask your question on
65
- <a href="https://chat.vuejs.org" target="_blank" rel="noopener">Vue Land</a>, our official
66
- Discord server, or
67
- <a href="https://stackoverflow.com/questions/tagged/vue.js" target="_blank" rel="noopener"
68
- >StackOverflow</a
69
- >. You should also subscribe to
70
- <a href="https://news.vuejs.org" target="_blank" rel="noopener">our mailing list</a> and follow
71
- the official
72
- <a href="https://twitter.com/vuejs" target="_blank" rel="noopener">@vuejs</a>
73
- twitter account for latest news in the Vue world.
74
- </WelcomeItem>
75
-
76
- <WelcomeItem>
77
- <template #icon>
78
- <SupportIcon />
79
- </template>
80
- <template #heading>Support Vue</template>
81
-
82
- As an independent project, Vue relies on community backing for its sustainability. You can help
83
- us by
84
- <a href="https://vuejs.org/sponsor/" target="_blank" rel="noopener">becoming a sponsor</a>.
85
- </WelcomeItem>
86
- </template>
@@ -1,86 +0,0 @@
1
- <template>
2
- <div class="item">
3
- <i>
4
- <slot name="icon"></slot>
5
- </i>
6
- <div class="details">
7
- <h3>
8
- <slot name="heading"></slot>
9
- </h3>
10
- <slot></slot>
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <style scoped>
16
- .item {
17
- margin-top: 2rem;
18
- display: flex;
19
- }
20
-
21
- .details {
22
- flex: 1;
23
- margin-left: 1rem;
24
- }
25
-
26
- i {
27
- display: flex;
28
- place-items: center;
29
- place-content: center;
30
- width: 32px;
31
- height: 32px;
32
-
33
- color: var(--color-text);
34
- }
35
-
36
- h3 {
37
- font-size: 1.2rem;
38
- font-weight: 500;
39
- margin-bottom: 0.4rem;
40
- color: var(--color-heading);
41
- }
42
-
43
- @media (min-width: 1024px) {
44
- .item {
45
- margin-top: 0;
46
- padding: 0.4rem 0 1rem calc(var(--section-gap) / 2);
47
- }
48
-
49
- i {
50
- top: calc(50% - 25px);
51
- left: -26px;
52
- position: absolute;
53
- border: 1px solid var(--color-border);
54
- background: var(--color-background);
55
- border-radius: 8px;
56
- width: 50px;
57
- height: 50px;
58
- }
59
-
60
- .item:before {
61
- content: ' ';
62
- border-left: 1px solid var(--color-border);
63
- position: absolute;
64
- left: 0;
65
- bottom: calc(50% + 25px);
66
- height: calc(50% - 25px);
67
- }
68
-
69
- .item:after {
70
- content: ' ';
71
- border-left: 1px solid var(--color-border);
72
- position: absolute;
73
- left: 0;
74
- top: calc(50% + 25px);
75
- height: calc(50% - 25px);
76
- }
77
-
78
- .item:first-of-type:before {
79
- display: none;
80
- }
81
-
82
- .item:last-of-type:after {
83
- display: none;
84
- }
85
- }
86
- </style>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
3
- <path
4
- d="M15 4a1 1 0 1 0 0 2V4zm0 11v-1a1 1 0 0 0-1 1h1zm0 4l-.707.707A1 1 0 0 0 16 19h-1zm-4-4l.707-.707A1 1 0 0 0 11 14v1zm-4.707-1.293a1 1 0 0 0-1.414 1.414l1.414-1.414zm-.707.707l-.707-.707.707.707zM9 11v-1a1 1 0 0 0-.707.293L9 11zm-4 0h1a1 1 0 0 0-1-1v1zm0 4H4a1 1 0 0 0 1.707.707L5 15zm10-9h2V4h-2v2zm2 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2zm1 1v6h2V7h-2zm0 6a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2zm-1 1h-2v2h2v-2zm-3 1v4h2v-4h-2zm1.707 3.293l-4-4-1.414 1.414 4 4 1.414-1.414zM11 14H7v2h4v-2zm-4 0c-.276 0-.525-.111-.707-.293l-1.414 1.414C5.42 15.663 6.172 16 7 16v-2zm-.707 1.121l3.414-3.414-1.414-1.414-3.414 3.414 1.414 1.414zM9 12h4v-2H9v2zm4 0a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2zm3-3V3h-2v6h2zm0-6a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2zm-3-3H3v2h10V0zM3 0a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1V0zM0 3v6h2V3H0zm0 6a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1H0zm3 3h2v-2H3v2zm1-1v4h2v-4H4zm1.707 4.707l.586-.586-1.414-1.414-.586.586 1.414 1.414z"
5
- />
6
- </svg>
7
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" fill="currentColor">
3
- <path
4
- d="M11 2.253a1 1 0 1 0-2 0h2zm-2 13a1 1 0 1 0 2 0H9zm.447-12.167a1 1 0 1 0 1.107-1.666L9.447 3.086zM1 2.253L.447 1.42A1 1 0 0 0 0 2.253h1zm0 13H0a1 1 0 0 0 1.553.833L1 15.253zm8.447.833a1 1 0 1 0 1.107-1.666l-1.107 1.666zm0-14.666a1 1 0 1 0 1.107 1.666L9.447 1.42zM19 2.253h1a1 1 0 0 0-.447-.833L19 2.253zm0 13l-.553.833A1 1 0 0 0 20 15.253h-1zm-9.553-.833a1 1 0 1 0 1.107 1.666L9.447 14.42zM9 2.253v13h2v-13H9zm1.553-.833C9.203.523 7.42 0 5.5 0v2c1.572 0 2.961.431 3.947 1.086l1.107-1.666zM5.5 0C3.58 0 1.797.523.447 1.42l1.107 1.666C2.539 2.431 3.928 2 5.5 2V0zM0 2.253v13h2v-13H0zm1.553 13.833C2.539 15.431 3.928 15 5.5 15v-2c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM5.5 15c1.572 0 2.961.431 3.947 1.086l1.107-1.666C9.203 13.523 7.42 13 5.5 13v2zm5.053-11.914C11.539 2.431 12.928 2 14.5 2V0c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM14.5 2c1.573 0 2.961.431 3.947 1.086l1.107-1.666C18.203.523 16.421 0 14.5 0v2zm3.5.253v13h2v-13h-2zm1.553 12.167C18.203 13.523 16.421 13 14.5 13v2c1.573 0 2.961.431 3.947 1.086l1.107-1.666zM14.5 13c-1.92 0-3.703.523-5.053 1.42l1.107 1.666C11.539 15.431 12.928 15 14.5 15v-2z"
5
- />
6
- </svg>
7
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" fill="currentColor">
3
- <path
4
- d="M11.447 8.894a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm0 1.789a1 1 0 1 0 .894-1.789l-.894 1.789zM7.447 7.106a1 1 0 1 0-.894 1.789l.894-1.789zM10 9a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0H8zm9.447-5.606a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm2 .789a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zM18 5a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0h-2zm-5.447-4.606a1 1 0 1 0 .894-1.789l-.894 1.789zM9 1l.447-.894a1 1 0 0 0-.894 0L9 1zm-2.447.106a1 1 0 1 0 .894 1.789l-.894-1.789zm-6 3a1 1 0 1 0 .894 1.789L.553 4.106zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zm-2-.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 2.789a1 1 0 1 0 .894-1.789l-.894 1.789zM2 5a1 1 0 1 0-2 0h2zM0 7.5a1 1 0 1 0 2 0H0zm8.553 12.394a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 1a1 1 0 1 0 .894 1.789l-.894-1.789zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zM8 19a1 1 0 1 0 2 0H8zm2-2.5a1 1 0 1 0-2 0h2zm-7.447.394a1 1 0 1 0 .894-1.789l-.894 1.789zM1 15H0a1 1 0 0 0 .553.894L1 15zm1-2.5a1 1 0 1 0-2 0h2zm12.553 2.606a1 1 0 1 0 .894 1.789l-.894-1.789zM17 15l.447.894A1 1 0 0 0 18 15h-1zm1-2.5a1 1 0 1 0-2 0h2zm-7.447-5.394l-2 1 .894 1.789 2-1-.894-1.789zm-1.106 1l-2-1-.894 1.789 2 1 .894-1.789zM8 9v2.5h2V9H8zm8.553-4.894l-2 1 .894 1.789 2-1-.894-1.789zm.894 0l-2-1-.894 1.789 2 1 .894-1.789zM16 5v2.5h2V5h-2zm-4.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zm-2.894-1l-2 1 .894 1.789 2-1L8.553.106zM1.447 5.894l2-1-.894-1.789-2 1 .894 1.789zm-.894 0l2 1 .894-1.789-2-1-.894 1.789zM0 5v2.5h2V5H0zm9.447 13.106l-2-1-.894 1.789 2 1 .894-1.789zm0 1.789l2-1-.894-1.789-2 1 .894 1.789zM10 19v-2.5H8V19h2zm-6.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zM2 15v-2.5H0V15h2zm13.447 1.894l2-1-.894-1.789-2 1 .894 1.789zM18 15v-2.5h-2V15h2z"
5
- />
6
- </svg>
7
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
3
- <path
4
- d="M10 3.22l-.61-.6a5.5 5.5 0 0 0-7.666.105 5.5 5.5 0 0 0-.114 7.665L10 18.78l8.39-8.4a5.5 5.5 0 0 0-.114-7.665 5.5 5.5 0 0 0-7.666-.105l-.61.61z"
5
- />
6
- </svg>
7
- </template>
@@ -1,19 +0,0 @@
1
- <!-- This icon is from <https://github.com/Templarian/MaterialDesign>, distributed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) license-->
2
- <template>
3
- <svg
4
- xmlns="http://www.w3.org/2000/svg"
5
- xmlns:xlink="http://www.w3.org/1999/xlink"
6
- aria-hidden="true"
7
- role="img"
8
- class="iconify iconify--mdi"
9
- width="24"
10
- height="24"
11
- preserveAspectRatio="xMidYMid meet"
12
- viewBox="0 0 24 24"
13
- >
14
- <path
15
- d="M20 18v-4h-3v1h-2v-1H9v1H7v-1H4v4h16M6.33 8l-1.74 4H7v-1h2v1h6v-1h2v1h2.41l-1.74-4H6.33M9 5v1h6V5H9m12.84 7.61c.1.22.16.48.16.8V18c0 .53-.21 1-.6 1.41c-.4.4-.85.59-1.4.59H4c-.55 0-1-.19-1.4-.59C2.21 19 2 18.53 2 18v-4.59c0-.32.06-.58.16-.8L4.5 7.22C4.84 6.41 5.45 6 6.33 6H7V5c0-.55.18-1 .57-1.41C7.96 3.2 8.44 3 9 3h6c.56 0 1.04.2 1.43.59c.39.41.57.86.57 1.41v1h.67c.88 0 1.49.41 1.83 1.22l2.34 5.39z"
16
- fill="currentColor"
17
- ></path>
18
- </svg>
19
- </template>
@@ -1,6 +0,0 @@
1
- import { createApp } from "vue";
2
- import App from "./App.vue";
3
-
4
- import "./assets/main.css";
5
-
6
- createApp(App).mount("#app");
@@ -1,16 +0,0 @@
1
- {
2
- "extends": "@vue/tsconfig/tsconfig.web.json",
3
- "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4
- "compilerOptions": {
5
- "baseUrl": ".",
6
- "paths": {
7
- "@/*": ["./src/*"]
8
- }
9
- },
10
-
11
- "references": [
12
- {
13
- "path": "./tsconfig.node.json"
14
- }
15
- ]
16
- }
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@vue/tsconfig/tsconfig.node.json",
3
- "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
4
- "compilerOptions": {
5
- "composite": true,
6
- "types": ["node"]
7
- }
8
- }
@@ -1,15 +0,0 @@
1
- import { fileURLToPath, URL } from "node:url";
2
-
3
- import { defineConfig } from "vite";
4
- import vue from "@vitejs/plugin-vue";
5
- import "./ngrok.config.ts";
6
-
7
- // https://vitejs.dev/config/
8
- export default defineConfig({
9
- plugins: [vue()],
10
- resolve: {
11
- alias: {
12
- "@": fileURLToPath(new URL("./src", import.meta.url)),
13
- },
14
- },
15
- });
package/flake.lock DELETED
@@ -1,82 +0,0 @@
1
- {
2
- "nodes": {
3
- "fenix-flake": {
4
- "inputs": {
5
- "nixpkgs": [
6
- "nixpkgs"
7
- ],
8
- "rust-analyzer-src": "rust-analyzer-src"
9
- },
10
- "locked": {
11
- "lastModified": 1674541370,
12
- "narHash": "sha256-L62dKDX6fIUQhlna9R8PKSAEGZ7ueU5gRGxZzZs/Zx8=",
13
- "owner": "nix-community",
14
- "repo": "fenix",
15
- "rev": "4435f8e9da13581e51ba1f92a25d7d54c776ad94",
16
- "type": "github"
17
- },
18
- "original": {
19
- "owner": "nix-community",
20
- "repo": "fenix",
21
- "type": "github"
22
- }
23
- },
24
- "flake-utils": {
25
- "locked": {
26
- "lastModified": 1667395993,
27
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
28
- "owner": "numtide",
29
- "repo": "flake-utils",
30
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
31
- "type": "github"
32
- },
33
- "original": {
34
- "owner": "numtide",
35
- "repo": "flake-utils",
36
- "type": "github"
37
- }
38
- },
39
- "nixpkgs": {
40
- "locked": {
41
- "lastModified": 1674457414,
42
- "narHash": "sha256-HGoDKtOXIKvU72/4gL3VUYla/YExhS0oPoiIuDjlTrg=",
43
- "owner": "nixos",
44
- "repo": "nixpkgs",
45
- "rev": "f32319e7ba8f03ea2f1c66a5ffe43b4e771108f5",
46
- "type": "github"
47
- },
48
- "original": {
49
- "owner": "nixos",
50
- "ref": "nixpkgs-unstable",
51
- "repo": "nixpkgs",
52
- "type": "github"
53
- }
54
- },
55
- "root": {
56
- "inputs": {
57
- "fenix-flake": "fenix-flake",
58
- "flake-utils": "flake-utils",
59
- "nixpkgs": "nixpkgs"
60
- }
61
- },
62
- "rust-analyzer-src": {
63
- "flake": false,
64
- "locked": {
65
- "lastModified": 1674491573,
66
- "narHash": "sha256-1hMPOn2dlMfWRWvuaWcSxNquKpvjGVXq2rVw6UJy75Q=",
67
- "owner": "rust-lang",
68
- "repo": "rust-analyzer",
69
- "rev": "c552e5a55f13b2f08d506bb46fb74dbc11702d0d",
70
- "type": "github"
71
- },
72
- "original": {
73
- "owner": "rust-lang",
74
- "ref": "nightly",
75
- "repo": "rust-analyzer",
76
- "type": "github"
77
- }
78
- }
79
- },
80
- "root": "root",
81
- "version": 7
82
- }
package/flake.nix DELETED
@@ -1,111 +0,0 @@
1
- {
2
- description = "ngrok agent library for NodeJS";
3
-
4
- inputs = {
5
- nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
6
-
7
- # Note: fenix packages are cached via cachix:
8
- # cachix use nix-community
9
- fenix-flake = {
10
- url = "github:nix-community/fenix";
11
- inputs.nixpkgs.follows = "nixpkgs";
12
- };
13
-
14
- flake-utils = {
15
- url = "github:numtide/flake-utils";
16
- inputs.nixpkgs.follows = "nixpkgs";
17
- };
18
- };
19
-
20
- outputs = { self, nixpkgs, fenix-flake, flake-utils }:
21
- flake-utils.lib.eachDefaultSystem (system:
22
- let
23
- pkgs = import nixpkgs {
24
- inherit system;
25
- overlays = [
26
- fenix-flake.overlays.default
27
- ];
28
- };
29
- toolchain = pkgs.fenix.complete.withComponents [
30
- "cargo"
31
- "clippy"
32
- "rust-src"
33
- "rustc"
34
- "rustfmt"
35
- ];
36
- node-toolchain = with pkgs; [
37
- nodejs
38
- yarn
39
- ];
40
- fix-n-fmt = pkgs.writeShellScriptBin "fix-n-fmt" ''
41
- set -euf -o pipefail
42
- ${toolchain}/bin/cargo clippy --fix --allow-staged --allow-dirty --all-targets --all-features
43
- ${toolchain}/bin/cargo fmt
44
- '';
45
- pre-commit = pkgs.writeShellScript "pre-commit" ''
46
- cargo clippy --workspace --all-targets --all-features -- -D warnings
47
- result=$?
48
-
49
- if [[ ''${result} -ne 0 ]] ; then
50
- cat <<\EOF
51
- There are some linting issues, try `fix-n-fmt` to fix.
52
- EOF
53
- exit 1
54
- fi
55
-
56
- # Use a dedicated sub-target-dir for udeps. For some reason, it fights with clippy over the cache.
57
- CARGO_TARGET_DIR=$(git rev-parse --show-toplevel)/target/udeps cargo udeps --workspace --all-targets --all-features
58
- result=$?
59
-
60
- if [[ ''${result} -ne 0 ]] ; then
61
- cat <<\EOF
62
- There are some unused dependencies.
63
- EOF
64
- exit 1
65
- fi
66
-
67
- diff=$(cargo fmt -- --check)
68
- result=$?
69
-
70
- if [[ ''${result} -ne 0 ]] ; then
71
- cat <<\EOF
72
- There are some code style issues, run `fix-n-fmt` first.
73
- EOF
74
- exit 1
75
- fi
76
-
77
- exit 0
78
- '';
79
- setup-hooks = pkgs.writeShellScriptBin "setup-hooks" ''
80
- repo_root=$(git rev-parse --git-dir)
81
-
82
- ${toString (map (h: ''
83
- ln -sf ${h} ''${repo_root}/hooks/${h.name}
84
- '') [
85
- pre-commit
86
- ])}
87
- '';
88
- in
89
- {
90
- devShell = pkgs.mkShell {
91
- CHALK_OVERFLOW_DEPTH = 3000;
92
- CHALK_SOLVER_MAX_SIZE = 1500;
93
- OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
94
- OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
95
- shellHook = ''
96
- export PATH="$PATH:$(git rev-parse --show-toplevel)/node_modules/.bin:$(git rev-parse --show-toplevel)/examples/node_modules/.bin"
97
- '';
98
- buildInputs = with pkgs; [
99
- toolchain
100
- node-toolchain
101
- fix-n-fmt
102
- setup-hooks
103
- cargo-udeps
104
- ] ++ lib.optionals stdenv.isDarwin [
105
- # nix darwin stdenv has broken libiconv: https://github.com/NixOS/nixpkgs/issues/158331
106
- libiconv
107
- pkgs.darwin.apple_sdk.frameworks.Security
108
- ];
109
- };
110
- });
111
- }
package/post-build.js DELETED
@@ -1,45 +0,0 @@
1
- // basically "cat gen.js trailer.js > index.js" but in nodejs to be cross-platform
2
- // called from 'yarn build', configured in package.json
3
- // e.g.: node post-build.js trailer index <input_file_path>
4
-
5
- var args = process.argv.slice(2);
6
- var trailer_prefix = args[0];
7
- var output_prefix = args[1];
8
- var input_path = args[2];
9
-
10
- // skipping the typescript file since it actually isn't written before the call to pipe:
11
- // https://github.com/napi-rs/napi-rs/issues/1188
12
- if (input_path.endsWith(".d.ts")) {
13
- console.log("skipping .d.ts file: " + input_path);
14
- return;
15
- }
16
-
17
- // run for .js and .d.ts
18
- concat_files(trailer_prefix, output_prefix, input_path);
19
- concat_files(trailer_prefix, output_prefix, input_path.replace(/\.js/, ".d.ts"));
20
-
21
- function concat_files(trailer_prefix, output_prefix, input_path) {
22
- console.log(
23
- "trailer_prefix: '" +
24
- trailer_prefix +
25
- "' output_prefix: '" +
26
- output_prefix +
27
- "' input_path: '" +
28
- input_path +
29
- "'"
30
- );
31
- path = require("path");
32
- input_filename = path.basename(input_path);
33
- input_suffix = input_filename.substring(input_filename.indexOf("."), input_filename.length);
34
- output_filename = output_prefix + input_suffix;
35
-
36
- console.log("writing: " + output_filename);
37
- var fs = require("fs");
38
- // input to output
39
- var data = fs.readFileSync(input_path, "utf8");
40
- fs.writeFileSync(output_filename, data, { encoding: "utf8", flag: "w" });
41
- // trailer to output
42
- data = fs.readFileSync(trailer_prefix + input_suffix, "utf8");
43
- fs.writeFileSync(output_filename, data, { encoding: "utf8", flag: "a" });
44
- console.log("post-build complete");
45
- }
@@ -1,49 +0,0 @@
1
- // run with: node --trace-gc --expose-gc
2
- if (typeof global.gc !== "function") {
3
- console.log("must run with '--expose-gc'");
4
- process.exit();
5
- }
6
-
7
- const SegfaultHandler = require("../node_modules/segfault-handler");
8
- SegfaultHandler.registerHandler("crash.log");
9
-
10
- const http = require("http");
11
- http
12
- .createServer(function (req, res) {
13
- res.writeHead(200);
14
- res.write("Hello");
15
- res.end();
16
- })
17
- .listen(8081);
18
-
19
- var ngrok = require("..");
20
- // turn on debug
21
- ngrok.consoleLog();
22
-
23
- new ngrok.SessionBuilder()
24
- .authtokenFromEnv()
25
- .connect()
26
- .then((session) => {
27
- session
28
- .httpEndpoint()
29
- .listen()
30
- .then((listener) => {
31
- listener.forward("localhost:8081").await;
32
- console.log("listener: " + listener.url() + " id: " + listener.id());
33
- setTimeout(function () {
34
- console.log("\n\n=====> running gc");
35
- global.gc();
36
- }, 2000);
37
-
38
- setTimeout(function () {
39
- console.log("\n\n=====> closing and nulling listener");
40
- listener.close().await;
41
- listener = null;
42
- }, 4000);
43
-
44
- setTimeout(function () {
45
- console.log("\n\n=====> running gc");
46
- global.gc();
47
- }, 6000);
48
- });
49
- }).await;