Skip to content

Instantly share code, notes, and snippets.

@Jonahss
Created March 6, 2014 19:00
Show Gist options
  • Save Jonahss/9396938 to your computer and use it in GitHub Desktop.
Save Jonahss/9396938 to your computer and use it in GitHub Desktop.
MultipleTunnelTest
//this runs two named tunnels with DIFFERENT names, second one fails immediately.
//OUTPUT:
//>> tunnel1 started with status false
//>> tunnel0 started with status true
//** this gist automatically uploaded with the gist-it package on the Atom editor. Boo-ya!
SauceTunnel = require('sauce-tunnel');
var username = process.env.SAUCE_USERNAME;
var key = process.env.SAUCE_ACCESS_KEY;
var names = ['tunnel0', 'tunnel1']
var startCb = function(status){
console.log(this.identifier, 'started with status', status);
}
var tunnels = names.map(function(name){
var tunn = new SauceTunnel(username, key, name, true);
var cb = startCb.bind(tunn);
tunn.start(cb);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment