Created
May 27, 2015 21:09
-
-
Save nijotz/2ccbaa76d8d47ec9c8c5 to your computer and use it in GitHub Desktop.
Hacky way of getting the external URL to the ngrok proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ngrok 1.x