# BrowserMob Proxy
BrowserMob Proxy allows you to manipulate HTTP requests and responses, capture HTTP content, and export performance data as a [HAR file](http://www.softwareishard.com/blog/har-12-spec/).
BMP works well as a standalone proxy server, but it is especially useful when embedded in Selenium tests.
The latest version of BrowserMob Proxy is 2.1.2, powered by [LittleProxy](https://github.com/adamfisk/LittleProxy).
If you're running BrowserMob Proxy within a Java application or Selenium test, get started with [Embedded Mode](#getting-started-embedded-mode). If you want to run BMP from the
command line as a standalone proxy, start with [Standalone](#getting-started-standalone).
### Getting started: Embedded Mode
To use BrowserMob Proxy in your tests or application, add the `browsermob-core` dependency to your pom:
```xml
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-core</artifactId>
<version>2.1.2</version>
<scope>test</scope>
</dependency>
```
Start the proxy:
```java
BrowserMobProxy proxy = new BrowserMobProxyServer();
proxy.start(0);
int port = proxy.getPort(); // get the JVM-assigned port
// Selenium or HTTP client configuration goes here
```
Then configure your HTTP client to use a proxy running at the specified port.
**Using with Selenium?** See the [Using with Selenium](#using-with-selenium) section.
### Getting started: Standalone
To run in standalone mode from the command line, first 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).
Start the REST API:
```sh
./browsermob-proxy -port 8080
```
Then create a proxy server instance:
```sh
curl -X POST http://localhost:8080/proxy
{"port":8081}
```
The "port" is the port of the newly-created proxy instance, so configure your HTTP client or web browser to use a proxy on the returned port.
For more information on the features available in the REST API, see [the REST API documentation](#rest-api).
## Changes since the 2.1-beta series
**The `browsermob-core-littleproxy` module is now `browsermob-core`**
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.
**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 and higher.
*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
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.
```java
LegacyProxyServer proxy = new BrowserMobProxyServerLegacyAdapter();
proxy.setPort(8081); // method only supported by the legacy interface
proxy.start();
```
## Changes since 2.0.0
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.
The most important changes from 2.0 are:
- [Separate REST API and Embedded Mode modules](#embedded-mode). Include only the functionality you need.
- [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.
- [LittleProxy support](#littleproxy-support). More stable and more powerful than the legacy Jetty back-end.
### New BrowserMobProxy API
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.
We _highly_ recommend migrating existing code to the BrowserMobProxy interface using the `BrowserMobProxyServer` class.
### Using the LittleProxy implementation with 2.0.0 code
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)):
```java
// With the Jetty-based 2.0.0 release, BMP was created like this:
ProxyServer proxyServer = new ProxyServer();
proxyServer.start();
// [...]
// To use the LittleProxy-powered 2.1.2 release, simply change to
// the LegacyProxyServer interface and the adapter for the new
// LittleProxy-based implementation:
LegacyProxyServer proxyServer = new BrowserMobProxyServerLegacyAdapter();
proxyServer.start();
// Almost all deprecated 2.0.0 methods are supported by the
// new BrowserMobProxyServerLegacyAdapter implementation, so in most cases,
// no further code changes are necessary
```
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.
If you must continue using the legacy Jetty-based implementation, include the `browsermob-core-legacy` artifact instead of `browsermob-core`.
## Features and Usage
The proxy is programmatically controlled via a REST interface or by being embedded directly inside Java-based programs and unit tests. It captures performance data in the [HAR format](http://groups.google.com/group/http-archive-specification). In addition it can actually control HTTP traffic, such as:
- blacklisting and whitelisting certain URL patterns
- simulating various bandwidth and latency
- remapping DNS lookups
- flushing DNS caching
- controlling DNS and request timeouts
- automatic BASIC authorization
### REST API
**New in 2.1:** The REST API now supports LittleProxy. As of 2.1.0-beta-3, LittleProxy is the default implementation. (You may specify `--use-littleproxy false` to disable LittleProxy in favor of the legacy Jetty 5-based implementation.)
To get started, first start the proxy by running `browsermob-proxy` or `browsermob-proxy.bat` in the bin directory:
$ sh browsermob-proxy -port 8080
INFO 05/31 03:12:48 o.b.p.Main - Starting up...
2011-05-30 20:12:49.517:INFO::jetty-7.3.0.v20110203
2011-05-30 20:12:49.689:INFO::started o.e.j.s.ServletContextHandler{/,null}
2011-05-30 20:12:49.820:INFO::Started SelectChannelConnector@0.0.0.0:8080
Once started, there won't be an actual proxy running until you create a new proxy. You can do this by POSTing to /proxy:
[~]$ curl -X POST http://localhost:8080/proxy
{"port":8081}
or optionally specify your own port:
[~]$ curl -X POST -d '
没有合适的资源?快使用搜索试试~ 我知道了~
一个基于图同构网络模型预测Web漏洞位置的模糊测试工具.zip
共133个文件
py:33个
php:18个
txt:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 117 浏览量
2023-10-19
21:16:00
上传
评论
收藏 75.05MB ZIP 举报
温馨提示
一个基于图同构网络模型预测Web漏洞位置的模糊测试工具.zip
资源推荐
资源详情
资源评论
收起资源包目录
一个基于图同构网络模型预测Web漏洞位置的模糊测试工具.zip (133个子文件)
attributes 937B
browsermob-proxy.bat 3KB
browsermob-proxy 835B
ca-certificate-rsa.cer 1KB
ca-certificate-ec.cer 737B
chromedriver85 10.53MB
chromedriver86 10.69MB
chromedriver88 10.93MB
COPYING 34KB
COPYING 34KB
dat_bugs.dat 854B
dirty 8KB
geckodriver 6.68MB
.gitignore 70B
.gitignore 41B
.gitignore 13B
.gitignore 7B
.gitignore 7B
.gitignore 6B
.gitignore 0B
.gitignore 0B
ast_function_echo.hack 6KB
instr.sample_hack1.hack 2KB
sample_hack1.hack 2KB
login_page.hack 1KB
xss.hack 1KB
sample_hack2.hack 230B
sample_hack3.hack 125B
test.har 1.09MB
xss.html 33KB
test_html.html 8KB
html 2KB
xss.html 1019B
repl.ipy 1KB
browsermob-dist-2.1.4.jar 20.86MB
browsermob-core-2.1.4-javadoc.jar 479KB
browsermob-rest-2.1.4-javadoc.jar 111KB
browsermob-core-2.1.4-sources.jar 103KB
browsermob-rest-2.1.4-sources.jar 16KB
js 228B
settings.json 2KB
launch.json 796B
launch.json 775B
composer.json 225B
composer.json 176B
hh_autoload.json 105B
hhast-lint.json 0B
composer.lock 14KB
composer.lock 4KB
README.md 28KB
Example.md 3KB
README.md 2KB
README.md 2KB
README.md 816B
README.md 415B
README.md 89B
ss.md 0B
bugs.txt.old 75KB
ca-keystore-rsa.p12 3KB
ca-keystore-ec.p12 1019B
ESORICS_2021_webFuzz.pdf 445KB
composer.phar 2.1MB
BasicBlockVisitorAbstract.php 6KB
EdgeVisitor1.php 4KB
EdgeVisitor.php 4KB
instrumentor.php 3KB
NodeEdge.php 3KB
NodeVisitor.php 2KB
Argparser.php 2KB
PathVisitor.php 2KB
FileSystem.php 2KB
sample1.php 1KB
php 922B
sample1a.php 887B
testast.php 887B
FileScore.php 266B
mini.php 91B
sample2.php 88B
namespace.php 84B
test.php 33B
FileScore.py 51KB
curses_ui.py 19KB
curses_menu.py 19KB
fuzzer_blackbox.py 14KB
node.py 14KB
test_mutator.py 13KB
fuzzer_manual.py 12KB
mutator.py 12KB
types.py 9KB
test_node.py 8KB
test_parser.py 7KB
z_test_parser.py 7KB
worker.py 7KB
crawler.py 7KB
fuzzer.py 7KB
parser.py 7KB
detector.py 6KB
node_iterator.py 6KB
misc.py 6KB
browser.py 5KB
共 133 条
- 1
- 2
资源评论
天天501
- 粉丝: 605
- 资源: 4666
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功