Ngrok-tunnel gem is a simple ruby wrapper for ngrok
Clone or download
Latest commit d94d02e Aug 8, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Add rack-server.rb example Feb 20, 2016
lib/ngrok Bump gem version Aug 8, 2018
spec Handles the tunnel region parameter Jun 12, 2018
.gitignore Support remote addresses Feb 11, 2016
.rspec Initial commit Oct 22, 2014 Bump gem version Aug 8, 2018
Gemfile Initial commit Oct 22, 2014
LICENSE.txt Initial commit Oct 22, 2014 Update Feb 20, 2016
Rakefile Initial commit Oct 22, 2014
ngrok-tunnel.gemspec Change gem description Oct 24, 2014


Ngrok-tunnel gem is a ruby wrapper for ngrok v2.

Gem Version Code Climate


Note: You must have ngrok v2+ installed available in your PATH.

Add this line to your application's Gemfile:

gem 'ngrok-tunnel'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ngrok-tunnel


require 'ngrok/tunnel'

# spawn ngrok (default port 3001)

# ngrok local_port
=> 3001

# ngrok external url
=> ""

=> ""

=> true

=> false

# ngrok process id
=> 27384

# ngrok log file descriptor
=> #<File:/tmp/ngrok20141022-27376-cmmiq4>

# kill ngrok
=> :stopped
# ngrok custom parameters
Ngrok::Tunnel.start(addr: '',
                    subdomain: 'MY_SUBDOMAIN',
                    hostname: 'MY_HOSTNAME',
                    authtoken: 'MY_TOKEN',
                    inspect: false,
                    log: 'ngrok.log',
                    config: '~/.ngrok')

With Rails (Rack server)

See examples/rack-server.rb to get an idea how to use it along with a Rack server so that it automatically starts and stops when a Rack server does.

With RSpec and Capybara

Use this gem: ngrok-rspec


  1. Fork it ( )
  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