
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
browsermob-proxy-client
Advanced tools
A library built to interact with browsermob-proxy's REST Api. Browsermob proxy has not been updated in several years, it is unlikely that this library will see any substantial updates anytime soon
npm install browsermob-proxy-clientconst webdriver = require('selenium-webdriver');
const By = webdriver.By;
const until = webdriver.until;
const selProxy = require('selenium-webdriver/proxy');
const bmpClient = require('browsermob-proxy-client').createClient();
//need to require this or it looks for a globally installed chromedriver
const chromedriver = require('chromedriver');
async function runBmp() {
await bmpClient.start();
await bmpClient.createHar();
const driver = new webdriver.Builder()
.forBrowser('chrome')
.setProxy(selProxy.manual({ http: 'localhost:' + bmpClient.proxy.port }))
.build();
await driver.get("https://search.yahoo.com");
const harData = await bmpClient.getHar();
//do something
console.log(harData);
await bmpClient.end();
}
runBmp()
.then(function () {
console.log("Finished Successfully");
process.exit([0]);
})
.catch(function (err) {
console.error(err.message);
console.error(err.stack)
process.exit([1]);
});
Synchronous function that instantiates a new client
config
{
browserMob:{ // *optional* details on where browsermob is running
host:'localhost',
port: 8080,
protocol:'http'
},
proxy:{ // *optional*
port:8081,
bindAddress: `192.168.1.222`
}
}
Method to make direct calls to browsermob-proxy's REST API see browsermob-proxy for available urls. Returns a promise.
url
String - '/har' (see https://github.com/lightbody/browsermob-proxy#rest-api, for a list of endpoints)
method
String - 'GET, POST, DELETE, PUT'
data
Object - { enable: true }
Returns a promise that closes all proxies running
Returns a promise. Creates a har file on browsermob
options
{
captureHeaders: - Boolean, capture headers or not.
Optional, default to "false".
captureContent: - Boolean, capture content bodies or not.
Optional, default to "false".
captureBinaryContent: Boolean, capture binary content or not.
Optional, default to "false".
initialPageRef: - The string name of The first page ref
that should be used in the HAR. Optional,
default to "Page 1".
initialPageTitle: - The title of first HAR page. Optional,
default to initialPageRef.
}
Returns a promise that stops the proxy port
Returns a promise that resolves to a har in JSON format
Resolves to { proxyList: [ { port: 8081 }, { port: 8082 }, { port: 8083 } ]
sets limits on the proxy
options
{
downstreamKbps: - Sets the downstream bandwidth limit in kbps. Optional.
upstreamKbps: - Sets the upstream bandwidth limit kbps. Optional, by default unlimited.
downstreamMaxKB: - Specifies how many kilobytes in total the client is allowed to download through the proxy. Optional, by default unlimited.
upstreamMaxKB: - Specifies how many kilobytes in total the client is allowed to upload through the proxy. Optional, by default unlimited.
latency: - Add the given latency to each HTTP request. Optional, by default all requests are invoked without latency.
enable: - A boolean that enable bandwidth limiter. Optional, by default to "false", but setting any of the properties above will implicitly enable throttling
payloadPercentage: - Specifying what percentage of data sent is payload, e.g. use this to take into account overhead due to tcp/ip. Optional.
maxBitsPerSecond: - The max bits per seconds you want this instance of StreamManager to respect. Optional.
}
starts a port to use
options
{
port: 'specify a port to start the proxy on',
bindAddress: '192.168.1.222' // if working in a multi-home env
}
Install dependencies npm install
Install and run browsermob-proxy
npm run install-browsermob
npm run start-browsermob
Run the tests
npm test
FAQs
Javascript client for browsermob-proxy
The npm package browsermob-proxy-client receives a total of 700 weekly downloads. As such, browsermob-proxy-client popularity was classified as not popular.
We found that browsermob-proxy-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.