Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khrj/ngrok
Expose your localhost to the web. Ultra-simple deno wrapper for ngrok.
https://github.com/khrj/ngrok
deno expose localhost module ngrok web wrapper
Last synced: 12 days ago
JSON representation
Expose your localhost to the web. Ultra-simple deno wrapper for ngrok.
- Host: GitHub
- URL: https://github.com/khrj/ngrok
- Owner: khrj
- License: mit
- Created: 2020-10-25T07:10:35.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-03T20:43:01.000Z (over 2 years ago)
- Last Synced: 2024-10-17T18:46:32.973Z (about 1 month ago)
- Topics: deno, expose, localhost, module, ngrok, web, wrapper
- Language: TypeScript
- Homepage: https://deno.land/x/ngrok
- Size: 86.9 KB
- Stars: 11
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Usage
```ts
import { Ngrok } from "https://deno.land/x/[email protected]/mod.ts"const ngrok = await Ngrok.create({
protocol: "http",
port: 8080,
})ngrok.addEventListener("ready", (event) => {
console.log(event.detail) // Outputs a URL without the protocol, such as "33a229cb0344.ngrok.io"
})// ...
await ngrok.destroy()
```- `Ngrok.create` accepts `NgrokOptions`
```ts
interface NgrokOptions {
protocol: string
port: number
region?: string
subdomain?: string
authtoken?: string
extraArgs?: string[]
}
```### Disconnecting
Due to the way child-processes work, ngrok will continue running in the
background even after your program exits unless you destroy the instance```ts
import { Ngrok } from "https://deno.land/x/[email protected]/mod.ts"const ngrok = await Ngrok.create({
protocol: "http",
port: 8080,
})await ngrok.destroy()
```- Optionally provide an exit code: `await ngrok.destroy("SIGKILL")`
### API
See [generated documentation](https://doc.deno.land/https/deno.land/x/[email protected]/mod.ts)
## Permissions
- --allow-read
- --allow-write
- --allow-env
- --allow-net
- --allow-run```bash
deno run --allow-read --allow-write --allow-env --allow-net --allow-run test.ts
```alternatively, specify only -A
```bash
deno run -A test.ts
```## Supporters
[![Stargazers repo roster for @khrj/ngrok](https://reporoster.com/stars/khrj/ngrok)](https://github.com/khrj/ngrok/stargazers)
[![Forkers repo roster for @khrj/ngrok](https://reporoster.com/forks/khrj/ngrok)](https://github.com/khrj/ngrok/network/members)
## Related
- [Deno modules](https://github.com/khrj/deno-modules)