1 | # testingbot-tunnel-launcher
|
2 |
|
3 | A library to download and launch TestingBot Tunnel.
|
4 |
|
5 | ## Installation
|
6 |
|
7 | ```sh
|
8 | npm install testingbot-tunnel-launcher
|
9 | ```
|
10 |
|
11 | ## Usage
|
12 |
|
13 |
|
14 | ### Simple Usage
|
15 |
|
16 | ```javascript
|
17 | var testingbotTunnel = require('testingbot-tunnel-launcher');
|
18 |
|
19 | testingbotTunnel({
|
20 | apiKey: 'key',
|
21 | apiSecret: 'secret',
|
22 | verbose: true
|
23 | }, function (err, tunnel) {
|
24 | if (err) {
|
25 | console.error(err.message);
|
26 | return;
|
27 | }
|
28 | console.log("Tunnel ready");
|
29 |
|
30 | tunnel.close(function () {
|
31 | console.log("Tunnel closed completely");
|
32 | })
|
33 | });
|
34 | ```
|
35 |
|
36 | ### Advanced Usage
|
37 |
|
38 | ```javascript
|
39 |
|
40 | var testingbotTunnel = require('testingbot-tunnel-launcher'),
|
41 | options = {
|
42 |
|
43 | // The TestingBot API key which you can get for free, listed in our member area
|
44 | apiKey: 'key',
|
45 |
|
46 | // The TestingBot API secret which you can get for free, listed in our member area
|
47 | apiSecret: 'secret',
|
48 |
|
49 | // More verbose output from the tunnel
|
50 | verbose: true,
|
51 |
|
52 | // Port on which the tunnel Selenium relay will listen for
|
53 | // requests. Default 4445. (optional)
|
54 | se-port: null,
|
55 |
|
56 | // Proxy host and port the tunnel can use to connect to an upstream proxy
|
57 | // e.g. "localhost:1234" (optional)
|
58 | proxy: null,
|
59 |
|
60 | // a comma-separated list of domains that
|
61 | // will not go through the tunnel. (optional)
|
62 | fast-fail-regexps: null,
|
63 |
|
64 | // Write logging output to this logfile (optional)
|
65 | logfile: null,
|
66 |
|
67 | // Change the tunnel version - see versions on https://testingbot.com/support/other/tunnel
|
68 | tunnelVersion: "1.18"
|
69 | };
|
70 |
|
71 | testingbotTunnel(options, function(err, tunnel) {
|
72 | console.log("Started Tunnel");
|
73 | tunnel.close(function () {
|
74 | console.log("Closed tunnel");
|
75 | });
|
76 | });
|
77 |
|
78 | ```
|
79 |
|
80 | ### Credentials
|
81 |
|
82 | You can pass the TestingBot credentials as `apiKey` and `apiSecret` in the options.
|
83 |
|
84 | You can also create a ~/.testingbot file with apiKey:apiSecret as content
|
85 |
|
86 |
|
87 | ## Testing
|
88 |
|
89 | ```
|
90 | npm test
|
91 | ```
|
92 |
|
93 | ## Changelog
|
94 |
|
95 | ### v1.0.0
|
96 | - First release of testingbot-tunnel-launcher
|
97 |
|
98 |
|
99 |
|
100 | ## License
|
101 |
|
102 | (The MIT License)
|
103 |
|
104 | Copyright (c) TestingBot <info@testingbot.com>
|
105 |
|
106 | Permission is hereby granted, free of charge, to any person obtaining
|
107 | a copy of this software and associated documentation files (the
|
108 | 'Software'), to deal in the Software without restriction, including
|
109 | without limitation the rights to use, copy, modify, merge, publish,
|
110 | distribute, sublicense, and/or sell copies of the Software, and to
|
111 | permit persons to whom the Software is furnished to do so, subject to
|
112 | the following conditions:
|
113 |
|
114 | The above copyright notice and this permission notice shall be
|
115 | included in all copies or substantial portions of the Software.
|
116 |
|
117 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
118 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
119 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
120 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
121 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
122 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
123 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|