benruns / bmp-client Goto Github PK
View Code? Open in Web Editor NEWBrowsermob js client
Browsermob js client
Hi BenRuns,
bmp-client looks like a really nice syntax around the BrowserMob proxy rest client.
I found your project while doing a github search for new development against the browsermob proxy. Development on the main browsermob proxy seems to have died in 2016. It is missing support for brotli, HTTP/2 and modern java versions.
We have a fork we are building that has those things. Anyhow, thought I'd mention it as it is a drop-in replacement with the same published REST API. I also maintain the most popular Ruby browsermob client and we will be switching that over to this fork. Cheers,
Eric
There is a method in the original browsermob proxy api to add header to the http call. Is this something that can be achieved using this bmp client?
I tried to get the content of my response but i think im using createHar(options) wrong.
var defaultProxy;
defaultProxy = BrowserMob.createClient();
await defaultProxy.start( );
var caps = {
'acceptSslCerts': 'true',
'browserName': 'chrome',
'record_network': 'true',
'browserstack.console': 'verbose',
'chromeOptions': {
'args': ['--test-type', '--start-maximized', '--remote-debugging-port=9222', '-enable-benchmarking', '--enable-net-benchmarking', '--verbose', '--log-path=chromedriver.log']
}
};
let driver = new webdriver.Builder()
.withCapabilities(caps)
.setProxy(selProxy.manual(TestHelper.getManualProxy(defaultProxy.proxy.port)))
.build();
await defaultProxy.createHar({
captureContent:'true',
captureBinaryContent: 'true'
});
*my requests...*
const har = await defaultProxy.getHar();
i always get empty responses
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"cookies": [],
"headers": [],
"content": {
"size": 0,
"mimeType": "application/json;charset=UTF-8",
"comment": ""
},
Do you have an idea what i am doing wrong?
I'm trying to use this to test a login form that uses a wss connection to execute the login. While all rest requests are successful and recorded with brosermob (navigating to the login page from the landing page, filling up the login form) when i click login button, proxy reports this error
(LittleProxy-20-ClientToProxyWorker-1) (AWAITING_INITIAL) [id: 0xe7fb21cb, L:/0:0:0:0:0:0:0:1:8100 - R:/0:0:0:0:0:0:0:1:56108]: An IOException occurred on ClientToProxyConnection: Connection reset by peer
and the connection is lost. If i disable the proxy while setting up selenium we driver, the loging is successful. Any ideas on why this is so and how to fix it?
Thanks
Hi,
Just wondering if you can document an example of this with protractor-cucumber. I would like to use this client to proxy an application url and add headers to it so that I can SSO into the app. However, I do not have an idea as to how I should structure this. The example that you have is webdriverjs and though protractor does use webdriverjs under the hood we don't really instantiate the driver the way you have illustrated. I did take a stab at it using the browsermobproxy and here is my code for this: https://stackoverflow.com/questions/55094075/add-headers-to-home-page-url-using-browsermob-in-protractor-test-automation however the code doesn't work. So, hoping you can add an example or guide me at least with a blueprint as to how to go about using bmp-client with protractor
Example is wrong in the readme
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
These dependencies are deprecated:
Datasource | Name | Replacement PR? |
---|---|---|
npm | request |
|
npm | request-promise-native |
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.circleci/config.yml
package.json
request ^2.81.0
lodash ^4.17.4
request-promise-native ^1.0.3
chai 4.3.6
chromedriver 110.0.0
ip 1.1.8
mocha 10.2.0
selenium-webdriver 4.5.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.