A node.js wrapper around the Sauce Connect Proxy binary
npm install sauce-connect-tunnelA Node.js wrapper around the Saucelabs connect proxy binaries.
```
npm install --save-dev sauce-connect-tunnel
javascript
var sauceConnectTunnel = require('sauce-connect-tunnel');
var tunnel = new sauceConnectTunnel(process.env.SAUCE_USERNAME, process.env.SAUCE_ACCESSKEY);tunnel.start(function(status) {
if (!status) {
console.error('Something went wrong starting the tunnel');
}
console.log('Sauce Connect Tunnel ready');
tunnel.stop(function() {
console.log('Sauce Connect Tunnel destroyed');
});
});
`Options
`javascript
new sauceConnectTunnel(username, accessKey, tunnelId, enableTunnel, args);
`####
username
Username to saucelabs####
accessKey
Accesskey for saucelabs####
tunnelId
Unique identifier for the tunnel. It's optional and automatically generated when not specified. Note that the tunnel identifier may have to be passed in with the browsers object as a desired capability to enable traffic to use the tunnel. More details here####
enableTunnel
Boolean value to indicate if the tunnel is to be created or not. This value can be set to false to mock a tunnel creation if the site tested is publicly accessible. This value is optional and defaults to true.####
args
An array of option flags (see here). Example: ['--debug', '--direct-domains', 'www.google.com']`. It's optional.