Skip to content

Commit bb000bf

Browse files
committed
Updated README
1 parent 1b4ede4 commit bb000bf

1 file changed

Lines changed: 34 additions & 5 deletions

File tree

README.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ $ webpagetest --help
5858
* **screenshot** _[options] \<id\>_: get the fully loaded page screenshot in JPG format (PNG if in full resolution)
5959
* **video** _[options] \<tests\>_: create a video from _\<tests\>_ (comma separated test ids)
6060
* **player _\<id\>_: get a html5 player for a video _\<id\>_
61-
* **listen** _[port]_: start webpagetest-api server on port _[7791_]
61+
* **listen** _[options]_ _[port]_: start webpagetest-api server on port _[7791_]
6262
* **batch** _\<file\>_: run commands in batch, i.e. one command per line from _\<file\>_ in parallel
6363

6464
### Options
@@ -107,16 +107,21 @@ _The default WPT server can also be specified via environment variable `WEBPAGET
107107
* **-A, --noads**: block ads defined by adblockrules.org
108108
* **-E, --aft**: (experimental) measure above-the-fold rendering time
109109
* **-Z, --spof** _\<domains\>_: space-delimited list of domains to simulate failure by re-routing to blackhole.webpagetest.org to silently drop all requests
110+
* **--htmlbody**: save the content of only the base HTML response
111+
* **--continuous**: capture video continuously (unstable/experimental, may cause tests to fail)
112+
* **--clearcerts**: clear the OS certificate caches (causes IE to do OCSP/CRL checks during SSL negotiation if the certificates are not already cached)
113+
* **--medianvideo**: store the video from the median run when capturing video is enabled
114+
* **--tsview** _\<id\>_: test name to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb)
110115
* **-W, --mobile**: (experimental) emulate mobile browser: Chrome mobile user agent, 640x960 screen, 2x scaling and fixed viewport (Chrome only)
111116
* **-M, --timeline**: capture Developer Tools Timeline (Chrome only)
112117
* **-G, --netlog**: capture Network Log (Chrome only)
113118
* **-C, --spdy3**: force SPDY version 3 (Chrome only)
114119
* **-J, --swrender**: force software rendering, disable GPU acceleration (Chrome only)
115120
* **-Q, --noparser**: disable threaded HTML parser (Chrome only)
116121
* **-q, --spdynossl**: use SPDY without SSL (Chrome only)
122+
* **--datareduction**: enable data reduction on Chrome 34+ Android (Chrome only)
123+
* **--useragent** _\<string\>_: custom user agent string (Chrome only)
117124
* **--cmdline** _\<switches\>_: use a list of custom command line switches (Chrome only)
118-
* **--htmlbody**: save the content of only the base HTML response
119-
* **--continuous**: capture video continuously (unstable/experimental, may cause tests to fail)
120125
* **--poll** _[interval]_: poll for results after test is scheduled at every \<interva\l> seconds [5]
121126
* **--wait** _[hostname:port]_: wait for test results informed by agent once complete listening on \<hostname\>:\<port\> [hostname:first port available above 8000]
122127
* **--timeout** _\<seconds\>_: timeout for polling and waiting results [no timeout]
@@ -166,6 +171,11 @@ _The default WPT server can also be specified via environment variable `WEBPAGET
166171
#### Response (works for **response** command only)
167172
* **-R, --request** _\<number\>_: the request number [1]
168173

174+
#### Listen (works for **listen** command only)
175+
* **-k, --key** _\<file\>_: private key file to use for SSL
176+
* **-c, --cert** _\<file\>_: public x509 certificate file to use for SSL
177+
178+
169179
### Examples
170180
#### 1. Get available locations
171181
```bash
@@ -335,7 +345,7 @@ Methods and options (including the one letter shorthands) are the same when usin
335345
* `getScreenshotImage(id, options, callback)`
336346
* `createVideo(tests, options, callback)`
337347
* `getEmbedVideoPlayer(id, options, callback)`
338-
* `listen(port, callback)`
348+
* `listen(port, options, callback)`
339349
* `scriptToString(script)`
340350

341351
### Parameters
@@ -418,13 +428,20 @@ wpt.runTest(script, function(err, data) {
418428
* **blockAds**: _Boolean_, block ads defined by adblockrules.org
419429
* **aftRenderingTime**: _Boolean_, (experimental) measure above-the-fold rendering time
420430
* **spof**: _[String]_, array of string of domains to simulate failure by re-routing to blackhole.webpagetest.org to silently drop all requests
431+
* **htmlBody**: _Boolean_, save the content of only the base HTML response
432+
* **continuous**: _Boolean_, capture video continuously (unstable/experimental, may cause tests to fail)
433+
* **clearCerts**: _Boolean_, clear the OS certificate caches (causes IE to do OCSP/CRL checks during SSL negotiation if the certificates are not already cached)
434+
* **medianVideo**: _Boolean_, store the video from the median run when capturing video is enabled
435+
* **tsView**: _String_, test name to use when submitting results to tsviewdb (for private instances that have integrated with tsviewdb)
421436
* **emulateMobile**: _Boolean_, (experimental) emulate mobile browser: Chrome mobile user agent, 640x960 screen, 2x scaling and fixed viewport (Chrome only)
422437
* **timeline**: _Boolean_, capture Developer Tools Timeline (Chrome only)
423438
* **netLog**: _Boolean_, capture Network Log (Chrome only)
424439
* **forceSpdy3**: _Boolean_, force SPDY version 3 (Chrome only)
425440
* **forceSoftwareRendering**: _Boolean_, force software rendering, disable GPU acceleration (Chrome only)
426441
* **disableThreadedParser**: _Boolean_, disable threaded HTML parser (Chrome only)
427442
* **spdyNoSSL**: _Boolean_, use SPDY without SSL (Chrome only)
443+
* **dataReduction**: _Boolean_, enable data reduction on Chrome 34+ Android (Chrome only)
444+
* **userAgent**: _String_, custom user agent string (Chrome only)
428445
* **commandLine**: _[String]_, use a list of custom command line switches (Chrome only)
429446
* **pollResults**: _Number_, poll for results after test is scheduled at every <interval> seconds [5]
430447
* **waitResults**: _String_, wait for test results informed by agent once complete listening on <hostname>:<port> [hostname:first port available above 8000]
@@ -475,6 +492,10 @@ wpt.runTest(script, function(err, data) {
475492
#### Response (works for `getResponseBody` method only)
476493
* **request** _Number_: the request number [1]
477494

495+
#### Listen (works for `listen` method only)
496+
* **key** _String_: private key file path to use for SSL
497+
* **cert** _String_: public x509 certificate file path to use for SSL
498+
478499
### Examples
479500

480501
#### 1. Instantiating
@@ -556,10 +577,18 @@ http://localhost:8080
556577
$ curl http://localhost:8080/help
557578
$ curl http://localhost:8080/test/twitter.com/?location=SanJose_IE9
558579
```
580+
```bash
581+
$ webpagetest listen 8443 --key key.pem --cert cert.pem --server wpt.foo.com
582+
```
583+
```bash
584+
server listening on port 8443
585+
https://localhost:8443
586+
```
559587

560588
#### Notes
561589
* port _8080_ is optional, default port is _7791_
562590
* `wpt.foo.com` is overriding the default `www.webpagetest.org` server but can still be overridden with `server` option
591+
* when _--key_ and _--cert_ are provided, HTTPS is used instead of default HTTP server
563592

564593
### Module
565594
```javascript
@@ -633,7 +662,7 @@ $ npm test
633662

634663
## Changelog
635664

636-
* 0.2.4: Added test options: clearcerts, medianvideo, datareduction, useragent and tsview
665+
* 0.2.4: Added test options: clearcerts, medianvideo, datareduction, useragent and tsview; HTTPS support to listen/proxy server
637666
* 0.2.3: Updated DevTools Timeline API url endpoint for timeline command
638667
* 0.2.2: Added response body command/method
639668
* 0.2.1: Added history, video, player, googleCsi commands and continuous option

0 commit comments

Comments
 (0)