Skip to content

Instantly share code, notes, and snippets.

@nijotz
Created May 27, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nijotz/2ccbaa76d8d47ec9c8c5 to your computer and use it in GitHub Desktop.
Save nijotz/2ccbaa76d8d47ec9c8c5 to your computer and use it in GitHub Desktop.
Hacky way of getting the external URL to the ngrok proxy
# Hacky way of getting the external URL to the ngrok proxy
require 'net/http'
uri = URI.parse('http://localhost:4040/http/in')
response = Net::HTTP.get_response(uri)
config_json = response.body.split("\n").grep(/window/)[0].sub(/.*parse\(\"/, '').sub(/\"\)\;/, '').gsub(/\\/, '')
external_url = JSON::parse(config_json)['UiState']['Tunnels'][1]['PublicUrl']
@nijotz
Copy link
Author

nijotz commented May 27, 2015

ngrok 1.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment