UNPKG

3.17 kBMarkdownView Raw
1# testingbot-tunnel-launcher
2
3[![Greenkeeper badge](https://badges.greenkeeper.io/testingbot/testingbot-tunnel-launcher.svg)](https://greenkeeper.io/)
4[![npm](https://img.shields.io/npm/v/testingbot-tunnel-launcher.svg?maxAge=2592000)](https://www.npmjs.com/package/testingbot-tunnel-launcher)
5[![dependencies Status](https://david-dm.org/testingbot/testingbot-tunnel-launcher/status.svg)](https://david-dm.org/testingbot/testingbot-tunnel-launcher)
6[![devDependencies Status](https://david-dm.org/testingbot/testingbot-tunnel-launcher/dev-status.svg)](https://david-dm.org/testingbot/testingbot-tunnel-launcher?type=dev)
7[![CircleCI](https://circleci.com/gh/testingbot/testingbot-tunnel-launcher.svg?style=shield)](https://circleci.com/gh/testingbot/testingbot-tunnel-launcher)
8
9A library to download and launch TestingBot Tunnel.
10
11## Installation
12
13```sh
14npm install testingbot-tunnel-launcher
15```
16
17## Usage
18
19
20### Simple Usage
21
22```javascript
23var testingbotTunnel = require('testingbot-tunnel-launcher');
24
25testingbotTunnel({
26 apiKey: 'key',
27 apiSecret: 'secret',
28 verbose: true
29}, function (err, tunnel) {
30 if (err) {
31 console.error(err.message);
32 return;
33 }
34 console.log("Tunnel ready");
35
36 tunnel.close(function () {
37 console.log("Tunnel closed completely");
38 })
39});
40```
41
42### Advanced Usage
43
44```javascript
45
46var testingbotTunnel = require('testingbot-tunnel-launcher'),
47 options = {
48
49 // The TestingBot API key which you can get for free, listed in our member area
50 apiKey: 'key',
51
52 // The TestingBot API secret which you can get for free, listed in our member area
53 apiSecret: 'secret',
54
55 // More verbose output from the tunnel
56 verbose: true,
57
58 // Port on which the tunnel Selenium relay will listen for
59 // requests. Default 4445. (optional)
60 se-port: null,
61
62 // Proxy host and port the tunnel can use to connect to an upstream proxy
63 // e.g. "localhost:1234" (optional)
64 proxy: null,
65
66 // a comma-separated list of domains that
67 // will not go through the tunnel. (optional)
68 fast-fail-regexps: null,
69
70 // Write logging output to this logfile (optional)
71 logfile: null,
72
73 // Change the tunnel version - see versions on https://testingbot.com/support/other/tunnel
74 tunnelVersion: "1.19" // or 2.1 (Java 8)
75 };
76
77testingbotTunnel(options, function(err, tunnel) {
78 console.log("Started Tunnel");
79 tunnel.close(function () {
80 console.log("Closed tunnel");
81 });
82});
83
84```
85
86### Credentials
87
88You can pass the TestingBot credentials as `apiKey` and `apiSecret` in the options.
89
90You can also create a `~/.testingbot` file with `apiKey:apiSecret` as content
91
92
93## Testing
94
95```
96npm test
97```
98
99## Changelog
100
101### v1.1.0
102- Get rid of exit handlers, they're causing issues
103- Add tests
104- Update dependencies
105
106### v1.0.7
107- Properly handle SIGINT, exit and uncaughtException
108
109### v1.0.6
110- Small fixes
111- Display new version/invalid credentials
112
113### v1.0.5
114- Add `tunnelVersion` support to specify which version of the tunnel you want to use
115
116### v1.0.1 - v1.0.4
117- Minor fixes
118
119### v1.0.0
120- First release of testingbot-tunnel-launcher
121
122
123
124## MIT license
125
126Copyright (c) TestingBot <info@testingbot.com>
\No newline at end of file