ngrok
Ngrok
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
:
dependencies:
ngrok:
github: watzon/ngrok.cr
Usage
require "ngrok"
ngrok = Ngrok.start
# ngrok address
ngrok.addr
# => "127.0.0.1:3001"
# ngrok external url
ngrok.ngrok_url
# => "http://aaa0e65.ngrok.io"
ngrok.ngrok_url_https
# => "https://aaa0e65.ngrok.io"
ngrok.running?
# => true
ngrok.stopped?
# => false
# ngrok process id
ngrok.pid
# => 27384
# keep the connection alive
sleep
Ngrok.start(addr: 'foo.dev:80',
subdomain: 'MY_SUBDOMAIN',
hostname: 'MY_HOSTNAME',
authtoken: 'MY_TOKEN',
inspect: false,
log: File.open("./log.txt", "w"),
config: '~/.ngrok')
Usage Examples
See the examples
directory for a couple usage examples.
Contributing
- Fork it ( https://github.com/watzon/ngrok.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- watzon Chris Watson - creator, maintainer