Skip to content

Instantly share code, notes, and snippets.

@rch850
Created May 17, 2017 01:10
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 rch850/219f7a6866429513aab20cdbb4683028 to your computer and use it in GitHub Desktop.
Save rch850/219f7a6866429513aab20cdbb4683028 to your computer and use it in GitHub Desktop.
const http = require('http')
const spawn = require('child_process').spawn
http.get('http://localhost:4040/api/tunnels', res => {
let rawData = ''
res.on('data', chunk => { rawData += chunk; })
res.on('end', () => {
JSON.parse(rawData).tunnels
.filter(t => t.proto === 'https')
.forEach(t => { spawn('open', [t.public_url]) })
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment