ngrok

Ngrok wrapper
0.2.0 released
watzon/ngrok.cr
25 1
Chris Watson

Ngrok

Travis Dependencies license

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

  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 Chris Watson - creator, maintainer
ngrok:
  github: watzon/ngrok.cr
  version: ~> 0.2.0
License MIT
Crystal 0.28.0

Authors

Dependencies 0

Development Dependencies 0

Last synced .
search fire star recently