Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cvan/phantomhar
a PhantomJS/SlimerJS script to generate HTTP Archive (HAR) data from captured network traffic
https://github.com/cvan/phantomhar
Last synced: 3 months ago
JSON representation
a PhantomJS/SlimerJS script to generate HTTP Archive (HAR) data from captured network traffic
- Host: GitHub
- URL: https://github.com/cvan/phantomhar
- Owner: cvan
- License: mit
- Created: 2014-01-22T03:35:23.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-04-27T01:10:51.000Z (almost 8 years ago)
- Last Synced: 2024-11-02T01:50:18.548Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 36
- Watchers: 2
- Forks: 5
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![PhantomHAR Logo](https://raw.githubusercontent.com/cvan/phantomHAR/master/images/logo.png "PhantomHAR Logo")
A PhantomJS script to generate
[HTTP Archive (HAR)](https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html)
data from captured network traffic.## Dependencies
To use PhantomJS:
[brew](http://brew.sh/) install [phantomjs](http://phantomjs.org/)
To use SlimerJS:
./install-packages.sh
## Installation
If you'd like easier CLI invocation, you can install PhantomHAR globally:
npm install -g phantomhar
Or clone the repo locally and install the Node dependencies:
git clone [email protected]:cvan/phantomHAR.git
npm install## Tests
To run tests:
npm test
## Usage
### Command-Line Interface
To run from the command line:
phantomhar
Alternatively:
node cli.js
This will output:
Usage: phantomhar [options]
Options:
-h, --help output usage information
-V, --version output the version number
-u, --url specify the url for which to generate a HAR
-d, --delay [delay] wait X seconds before generating the HAR [$PHANTOMHAR_DELAY || 1000]
-b, --bodies include response bodies in the HAR [$PHANTOMHAR_BODIES || false]
-H, --host [host] specify the server host [$PHANTOMHAR_HOST || 0.0.0.0]
-p, --port [port] specify the server port [$PHANTOMHAR_PORT || 4000]#### Output to `stdout`
##### Globally
phantomhar 'http://thephantomoftheopera.com'
##### Locally
node cli.js 'http://thephantomoftheopera.com'
#### Output to clipboard (Mac OS X)
##### Globally
phantomhar 'http://thephantomoftheopera.com' | pbcopy
##### Locally
node cli.js 'http://thephantomoftheopera.com' | pbcopy
#### Output to a file
##### Globally
phantomhar 'http://thephantomoftheopera.com' > 'tpoto.com-'$(date +%Y.%m.%d-%H.%M.%S)'.har'
##### Locally
node cli.js 'http://thephantomoftheopera.com' > 'tpoto.com-'$(date +%Y.%m.%d-%H.%M.%S)'.har'