You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-73Lines changed: 52 additions & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,37 +2,56 @@
2
2
3
3
BrowserMob Proxy is a simple utility that makes it easy to capture performance data from browsers, typically written using automation toolkits such as Selenium and Watir.
4
4
5
-
The latest version of BrowserMobProxy is 2.1.0-beta-6. It is the latest release that supports the [new BrowserMobProxy interface](#new-browsermobproxy-api), with the `BrowserMobProxyServer` implementation [powered by LittleProxy](#littleproxy-support). We highly recommend that you use 2.1.0-beta-6 instead of the [previous 2.0.0 release](https://github.com/lightbody/browsermob-proxy/tree/2.0).
5
+
The latest version of BrowserMobProxy is 2.1.0, powered by [LittleProxy](https://github.com/adamfisk/LittleProxy).
6
6
7
-
To use BrowserMob Proxy in your tests, add the `browsermob-core-littleproxy` dependency to your pom:
7
+
To use BrowserMob Proxy in your tests or application, add the `browsermob-core` dependency to your pom:
To run in standalone mode from the command line, download the latest release from the [releases page](https://github.com/lightbody/browsermob-proxy/releases), or [build the latest from source](#building-the-latest-from-source).
18
18
19
-
## Important Changes since 2.0.0
19
+
For more information on using BrowserMob Proxy with Selenium, see the [Using with Selenium](#using-with-selenium) section.
20
20
21
-
Since the 2.1 release is still in beta, some features and functionality (including the BrowserMobProxy interface) may change, although the new interface is largely stable. The most important changes from 2.0 are:
21
+
## Changes since the 2.1-beta series
22
22
23
-
-[Separate REST API and Embedded Mode modules](#embedded-mode). Include only the functionality you need.
24
-
-[New BrowserMobProxy interface](https://github.com/lightbody/browsermob-proxy/blob/master/browsermob-core/src/main/java/net/lightbody/bmp/BrowserMobProxy.java). The new interface will completely replace the legacy 2.0 ProxyServer contract in version 3.0 and higher.
25
-
-[LittleProxy support](#littleproxy-support). More powerful than the legacy Jetty back-end. For 2.1 releases, LittleProxy support will be provided through the `browsermob-core-littleproxy` module.
23
+
**The `browsermob-core-littleproxy` module is now `browsermob-core`**
24
+
25
+
After six beta releases, the LittleProxy implementation now supports more features and is more stable than the legacy implementation. To reflect that level of maturity and long-term support, the `browsermob-core` module now uses LittleProxy by default.
26
+
27
+
**Note about Legacy support**: In the 2.1-betas, if you were using the `ProxyServer` or `LegacyProxyServer` classes, use the `browsermob-core-legacy` module in 2.1.0.
28
+
29
+
*LittleProxy support for `LegacyProxyServer` has moved to `BrowserMobProxyServerLegacyAdapter`*. Using the LittleProxy implementation with the `LegacyProxyServer` interface is still fully supported as a means to help you transition from 2.0.0. Unlike the 2.1-beta series, the `BrowserMobProxyServer` class
30
+
no longer implements `LegacyProxyServer`; however, the `BrowserMobProxyServerLegacyAdapter` can be used to integrate legacy code with the new LittleProxy interface. You must still use the `browsermob-core-legacy` module when using the LegacyAdapter.
proxy.setPort(8081); // method only supported by the legacy interface
35
+
proxy.start();
36
+
```
37
+
38
+
## Changes since 2.0.0
39
+
40
+
The new [BrowserMobProxyServer class](browsermob-core/src/main/java/net/lightbody/bmp/BrowserMobProxyServer.java) has replaced the legacy ProxyServer implementation. The legacy implementation is no longer actively supported; all new code should use `BrowserMobProxyServer`. We highly recommend that existing code migrate to the new implementation.
26
41
27
-
See the [New Interface Compatibility Guide](new-interface-compatibility.md) for information on using the new BrowserMobProxy interface with the legacy ProxyServer implementation.
42
+
The most important changes from 2.0 are:
43
+
44
+
-[Separate REST API and Embedded Mode modules](#embedded-mode). Include only the functionality you need.
45
+
-[New BrowserMobProxy interface](browsermob-core/src/main/java/net/lightbody/bmp/BrowserMobProxy.java). The new interface will completely replace the legacy 2.0 ProxyServer contract in version 3.0 and higher.
46
+
-[LittleProxy support](#littleproxy-support). More stable and more powerful than the legacy Jetty back-end.
28
47
29
48
### New BrowserMobProxy API
30
49
31
-
BrowserMob Proxy 2.1 includes a [new BrowserMobProxy interface](https://github.com/lightbody/browsermob-proxy/blob/master/browsermob-core/src/main/java/net/lightbody/bmp/BrowserMobProxy.java) to interact with BrowserMob Proxy programmatically. The new interface defines the functionality that BrowserMob Proxy will support in future releases (including 3.0+). Both the legacy (Jetty-based) ProxyServer class and the new, LittleProxy-powered BrowserMobProxy class support the new BrowserMobProxy interface.
50
+
BrowserMob Proxy 2.1 includes a [new BrowserMobProxy interface](browsermob-core/src/main/java/net/lightbody/bmp/BrowserMobProxy.java) to interact with BrowserMob Proxy programmatically. The new interface defines the functionality that BrowserMob Proxy will support in future releases (including 3.0+). To ease migration, both the legacy (Jetty-based) ProxyServer class and the new, LittleProxy-powered BrowserMobProxy class support the new BrowserMobProxy interface.
32
51
33
-
To ease the upgrade path to 3.0 and beyond, we _highly_ recommend using the BrowserMobProxy interface, even if you continue to use the legacy ProxyServer implementation.
52
+
We _highly_ recommend migrating existing code to the BrowserMobProxy interface using the `BrowserMobProxyServer` class.
34
53
35
-
### Using the LittleProxy implementation with existing code
54
+
### Using the LittleProxy implementation with 2.0.0 code
36
55
37
56
The legacy interface, implicitly defined by the ProxyServer class, has been extracted into `net.lightbody.bmp.proxy.LegacyProxyServer` and is now officially deprecated. The new LittleProxy-based implementation will implement LegacyProxyServer for all 2.1.x releases. This means you can switch to the LittleProxy-powered implementation with minimal change to existing code ([with the exception of interceptors](#http-request-manipulation)):
38
57
@@ -43,35 +62,18 @@ The legacy interface, implicitly defined by the ProxyServer class, has been extr
43
62
// [...]
44
63
45
64
// To use the LittleProxy-powered 2.1.0 release, simply change to
46
-
// the LegacyProxyServer interface and the new LittleProxy-based implementation:
// Almost all deprecated 2.0.0 methods are supported by the
50
-
// new BrowserMobProxyServer implementation, so in most cases,
70
+
// new BrowserMobProxyServerLegacyAdapter implementation, so in most cases,
51
71
// no further code changes are necessary
52
72
```
53
73
54
74
LegacyProxyServer will not be supported after 3.0 is released, so we recommend migrating to the `BrowserMobProxy` interface as soon as possible. The new interface provides additional functionality and is compatible with both the legacy Jetty-based ProxyServer implementation [(with some exceptions)](new-interface-compatibility.md) and the new LittleProxy implementation.
55
75
56
-
### LittleProxy Support
57
-
58
-
BrowserMob Proxy now supports using LittleProxy instead of Jetty 5 + Apache HTTP Client. To enable LittleProxy support, include the `browsermob-core-littleproxy` artifact:
To continue using the legacy Jetty-based implementation, include the `browsermob-core` artifact.
76
+
If you must continue using the legacy Jetty-based implementation, include the `browsermob-core-legacy` artifact instead of `browsermob-core`.
75
77
76
78
## Features and Usage
77
79
@@ -208,15 +210,14 @@ system properties will be used to specify the upstream proxy.
208
210
209
211
**New in 2.1:** New [BrowserMobProxy interface](#new-browsermobproxy-api) for Embedded Mode
210
212
211
-
BrowserMob Proxy 2.1 separates the Embedded Mode and REST API into two modules. If you only need Embedded Mode functionality, add the `browsermob-core-littleproxy` artifact as a dependency. The REST API artifact is `browsermob-rest`.
213
+
BrowserMob Proxy 2.1 separates the Embedded Mode and REST API into two modules. If you only need Embedded Mode functionality, add the `browsermob-core` artifact as a dependency. The REST API artifact is `browsermob-rest`.
212
214
213
215
If you're using Java and Selenium, the easiest way to get started is to embed the project directly in your test. First, you'll need to make sure that all the dependencies are imported in to the project. You can find them in the *lib* directory. Or, if you're using Maven, you can add this to your pom:
214
216
```xml
215
217
<dependency>
216
218
<groupId>net.lightbody.bmp</groupId>
217
-
<!-- To use the legacy, Jetty-based implementation, change the artifactId to browsermob-core -->
@@ -263,9 +267,9 @@ You can use the REST API with Selenium however you want. But if you're writing y
263
267
264
268
### HTTP Request Manipulation
265
269
266
-
**HTTP request manipulation is changing with LittleProxy.** The LittleProxy-based interceptors are easier to use and more reliable. The legacy ProxyServer implementation **will not** support the new interceptor methods.
270
+
**HTTP request manipulation has changed in 2.1.0 with LittleProxy.** The LittleProxy-based interceptors are easier to use and more reliable. The legacy ProxyServer implementation **will not** support the new interceptor methods.
267
271
268
-
#### LittleProxy interceptors
272
+
#### 2.1.0 (LittleProxy) interceptors
269
273
270
274
There are four new methods to support request and response interception in LittleProxy:
271
275
@@ -365,13 +369,13 @@ Consult the Java API docs for more info.
365
369
366
370
### SSL Support
367
371
368
-
**BrowserMob with LittleProxy now supports full MITM:** For most users, MITM will work out-of-the-box with default settings. Install the [ca-certificate-rsa.cer](/browsermob-core/src/main/resources/sslSupport/ca-certificate-rsa.cer) file in your browser or HTTP client to avoid untrusted certificate warnings. Generally, it is safer to generate your own private key, rather than using the .cer files distributed with BrowserMob Proxy. See the [README file in the `mitm` module](/mitm/README.md) for instructions on generating or using your own root certificate and private key with MITM.
372
+
**BrowserMob Proxy 2.1.0 now supports full MITM:** For most users, MITM will work out-of-the-box with default settings. Install the [ca-certificate-rsa.cer](/browsermob-core/src/main/resources/sslSupport/ca-certificate-rsa.cer) file in your browser or HTTP client to avoid untrusted certificate warnings. Generally, it is safer to generate your own private key, rather than using the .cer files distributed with BrowserMob Proxy. See the [README file in the `mitm` module](/mitm/README.md) for instructions on generating or using your own root certificate and private key with MITM.
369
373
370
-
**Legacy Jetty-based ProxyServer support for MITM:**As of version 2.1.0-beta-4, the legacy `ProxyServer` implementation uses the same `ca-certificate-rsa.cer` root certificate as the LittleProxy implementation. The previous cybervillainsCA.cer certificate has been removed.
374
+
**Legacy Jetty-based ProxyServer support for MITM:**The legacy `ProxyServer` implementation uses the same `ca-certificate-rsa.cer` root certificate as the default BrowserMobProxyServer implementation. The previous cybervillainsCA.cer certificate has been removed.
371
375
372
376
**Note: DO NOT** permanently install the .cer files distributed with BrowserMob Proxy in users' browsers. They should be used for testing only and must not be used with general web browsing.
373
377
374
-
If you're doing testing with Selenium, you'll want to make sure that the browser profile that gets set up by Selenium not only has the proxy configured, but also has the CA installed. Unfortuantely, there is no API for doing this in Selenium, so you'll have to solve it uniquely for each browser type. We hope to make this easier in upcoming releases.
378
+
If you're doing testing with Selenium, you'll want to make sure that the browser profile that gets set up by Selenium not only has the proxy configured, but also has the CA installed. Unfortunately, there is no API for doing this in Selenium; it must be done manually for each browser and environment.
375
379
376
380
### NodeJS Support
377
381
@@ -381,49 +385,24 @@ NodeJS bindings for browswermob-proxy are available [here](https://github.com/zz
381
385
382
386
When running in stand-alone mode, the proxy loads the default logging configuration from the conf/bmp-logging.yaml file. To increase/decrease the logging level, change the logging entry for net.lightbody.bmp.
383
387
384
-
**New in 2.1:** Neither Embedded Mode nor the REST API include an slf4j static binding, so you no longer need to exclude the slf4j-jdk14 dependency when including `browsermob-core`, `browsermob-core-littleproxy` or `browsermob-rest`.
385
-
386
388
### DNS Resolution
387
389
388
-
**New in 2.1:** BrowserMob Proxy enables native DNS resolution by default.
389
-
390
-
The legacy Jetty-based ProxyServer implementation uses XBill (dnsjava) resolution, but automatically falls back to the default JVM DNS resolution if XBill cannot resolve the address. To disable native DNS fallback, set the `bmp.allowNativeDnsFallback` JVM property to `false`. You can also use the `BrowserMobProxy.setHostNameResolver()` method to disable native DNS fallback and/or dnsjava resolution itself.
391
-
392
-
When running from the command line:
393
-
394
-
$ JAVA_OPTS="-Dbmp.allowNativeDnsFallback=false" sh browsermob-proxy
395
-
396
-
or in Windows:
397
-
398
-
C:\browsermob-proxy\bin> set JAVA_OPTS="-Dbmp.allowNativeDnsFallback=false"
399
-
C:\browsermob-proxy\bin> browsermob-proxy.bat
400
-
401
-
If you are running in Embedded Mode (for example, within a Selenium test) you can disable native fallback or dnsjava by setting the implementation directly:
The BrowserMobProxyServer implementation uses native DNS resolution by default, but supports custom DNS resolution and advanced DNS manipulation. See the [ClientUtil](browsermob-proxy/browsermob-core/src/main/java/net/lightbody/bmp/client/ClientUtil.java) class for information on DNS manipulation using the dnsjava resolver.
412
391
413
392
## Building the latest from source
414
393
415
394
You'll need maven (`brew install maven` if you're on OS X); use the `release` profile to generate the batch files from this repository.
416
395
417
396
[~]$ mvn -DskipTests -P release
418
397
419
-
You'll find the standalone BrowserMob Proxy distributable zip at `browsermob-dist/target/browsermob-proxy-2.1.0-beta-6-SNAPSHOT-bin.zip`. Unzip the contents and run the `browsermob-proxy` or `browsermob-proxy.bat` files in the `bin` directory.
398
+
You'll find the standalone BrowserMob Proxy distributable zip at `browsermob-dist/target/browsermob-proxy-2.1.1-SNAPSHOT-bin.zip`. Unzip the contents and run the `browsermob-proxy` or `browsermob-proxy.bat` files in the `bin` directory.
420
399
421
400
When you build the latest code from source, you'll have access to the latest snapshot release. To use the SNAPSHOT version in your code, modify the version in your pom:
Copy file name to clipboardExpand all lines: new-interface-compatibility.md
+3-10Lines changed: 3 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,7 @@
1
-
New BrowserMobProxy Interface
2
-
=============================
3
-
The 2.1 beta releases of BrowserMob Proxy contain the new `BrowserMobProxy` interface. This interface specifies the methods that will be available in BrowserMob Proxy 3.0 and beyond.
4
-
Both the legacy `ProxyServer` class and the new LittleProxy-based `BrowserMobProxyServer` class implement the `BrowserMobProxy` interface, so all users can begin using the new
5
-
interface, even when using the legacy `ProxyServer` implementation.
1
+
# New BrowserMobProxy interface
2
+
The `BrowserMobProxyServer` class, powered by LitleProxy, implements the ``BrowserMobProxy` interface. The following table lists the current level of support for the new interface in the modern and legacy BMP implementations:
6
3
7
-
# New Interface Support
8
-
The LittleProxy-based implementation will support the entire `BrowserMobProxy` interface. The Jetty-based implementation in `ProxyServer` will support most, but not all, features of
9
-
the new interface. The following table lists the current level of support for the new interface:
0 commit comments