Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/watzon/ngrok.cr
Ngrok wrapper for Crystal
https://github.com/watzon/ngrok.cr
Last synced: about 2 months ago
JSON representation
Ngrok wrapper for Crystal
- Host: GitHub
- URL: https://github.com/watzon/ngrok.cr
- Owner: watzon
- License: mit
- Created: 2018-02-14T00:14:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-27T03:40:48.000Z (over 1 year ago)
- Last Synced: 2024-06-22T02:06:17.880Z (3 months ago)
- Language: Crystal
- Size: 21.5 KB
- Stars: 25
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - ngrok.cr - Ngrok wrapper (HTTP)
README
# Ngrok
[![Github Actions](https://github.com/watzon/ngrok.cr/workflows/Crystal/badge.svg)](https://github.com/watzon/ngrok.cr/workflows/Crystal) ![license](https://img.shields.io/github/license/watzon/ngrok.cr.svg)
Crystal wrapper for ngrok. This library does not require ngrok be installed as it includes a downloaded which will go and fetch the version of ngrok for your system and save it locally. If you do have ngrok installed it will use the installed version.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
ngrok:
github: watzon/ngrok.cr
```## Usage
### Authenticate with Ngrok
```crystal
Ngrok.auth("your token")
```### Start an Ngrok Session
```crystal
Ngrok.start(addr: "127.0.0.1:3001",
subdomain: nil,
hostname: nil,
timeout: 10.seconds,
inspect: false,
region: "us",
config: nil,
use_local_executable: true,
ngrok_bin: "./bin") do |ngrok|
# `ngrok.url` contains the http url for this session
puts ngrok.url# `ngrok.url_https` contains the https url for this session
puts ngrok.url_https
end
```## Usage Examples
See the `examples` directory for a couple usage examples.
## Contributing
1. Fork it ( https://github.com/watzon/ngrok.cr/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [watzon](https://github.com/watzon) Chris Watson - creator, maintainer