Client library for [BrowserMob Proxy] API
npm install browsermob-proxy-api-clientRefer to [REST API] section of BrowserMob Proxy documentation for detailed information






Using npm:
``bash`
$ npm install browsermob-proxy-api-client
Using yarn:
`bash`
$ yarn add browsermob-proxy-api-client
`typescript
import BrowserMobProxyAPIClient from 'browsermob-proxy-api-client';
const proxy = new BrowserMobProxyAPIClient('localhost', '8080');
const port = await proxy.start();
if (port) {
try {
await proxy.startHar(port);
// exec curl google.com --proxy localhost:${port}``
const har = await proxy.getHar(port);
} catch (e) {
console.error(e);
} finally {
await proxy.stop(port);
}
}
[BrowserMob Proxy]: https://github.com/lightbody/browsermob-proxy
[REST API]: https://github.com/lightbody/browsermob-proxy#rest-api