Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mohammed90/caddy-ngrok-listener
Caddy listener_wrapper to automatically listen on an ngrok tunnel
https://github.com/mohammed90/caddy-ngrok-listener
caddy caddy-module caddyserver ngrok
Last synced: 15 days ago
JSON representation
Caddy listener_wrapper to automatically listen on an ngrok tunnel
- Host: GitHub
- URL: https://github.com/mohammed90/caddy-ngrok-listener
- Owner: mohammed90
- License: apache-2.0
- Created: 2023-03-09T20:01:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-09T07:28:21.000Z (8 months ago)
- Last Synced: 2024-06-19T05:59:58.881Z (23 days ago)
- Topics: caddy, caddy-module, caddyserver, ngrok
- Language: Go
- Homepage:
- Size: 66.4 KB
- Stars: 19
- Watchers: 2
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-stars - mohammed90/caddy-ngrok-listener - Caddy listener_wrapper to automatically listen on an ngrok tunnel (Go)
README
ngrok/Caddy Listener Wrapper
=============================On March 9, 2023, ngrok announced the release of [ngrok-go](https://blog.ngrok.com/posts/ngrok-go)[^1], a Go package for embedding ngrok into a Go application. The package returns a `net.Listener`. This means it fits right into Caddy's [`listener_wrapper`](https://caddyserver.com/docs/json/apps/http/servers/listener_wrappers/)[^2]. Using this module, when Caddy asks for a listener, it will ask ngrok for the listener, for which ngrok return an ngrok ingress address that is publicly accessible. The public address is printed in logs and avaible on ngrok dashboard.
Currently, the module does not support the extended ngrok options, e.g. allow/deny CIDR. PRs are welcome.
[^1]: [Alan Shreve's tweet](https://twitter.com/inconshreveable/status/1633837669053792260)
[^2]: [`listener_wrappers` Caddyfile docs](https://caddyserver.com/docs/caddyfile/options#listener-wrappers)
## Example
### Caddyfile
```
{
servers :80 {
listener_wrappers {
ngrok {
auth_token $NGROK_AUTH_TOKEN
tunnel http {
}
}
}
}
}
:80 {
root * /path/to/site/root
file_server
}
```