Java Code Examples for net.lightbody.bmp.BrowserMobProxyServer#getFilterFactories()

The following examples show how to use net.lightbody.bmp.BrowserMobProxyServer#getFilterFactories() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BrowserMobHttpFilterChain.java    From CapturePacket with MIT License 6 votes vote down vote up
public BrowserMobHttpFilterChain(BrowserMobProxyServer proxyServer, HttpRequest originalRequest, ChannelHandlerContext ctx) {
    super(originalRequest, ctx);

    this.proxyServer = proxyServer;

    if (proxyServer.getFilterFactories() != null) {
        filters = new ArrayList<>(proxyServer.getFilterFactories().size());

        // instantiate all HttpFilters using the proxy's filter factories
        for (HttpFiltersSource filterFactory : proxyServer.getFilterFactories()) {
            HttpFilters filter = filterFactory.filterRequest(originalRequest, ctx);
            // allow filter factories to avoid adding a filter on a per-request basis by returning a null
            // HttpFilters instance
            if (filter != null) {
                filters.add(filter);
            }
        }
    } else {
        filters = Collections.emptyList();
    }
}
 
Example 2
Source File: BrowserMobHttpFilterChain.java    From Dream-Catcher with MIT License 6 votes vote down vote up
public BrowserMobHttpFilterChain(BrowserMobProxyServer proxyServer, HttpRequest originalRequest, ChannelHandlerContext ctx) {
    super(originalRequest, ctx);

    this.proxyServer = proxyServer;

    if (proxyServer.getFilterFactories() != null) {
        filters = new ArrayList<>(proxyServer.getFilterFactories().size());

        // instantiate all HttpFilters using the proxy's filter factories
        for (HttpFiltersSource filterFactory : proxyServer.getFilterFactories()) {
            HttpFilters filter = filterFactory.filterRequest(originalRequest, ctx);
            // allow filter factories to avoid adding a filter on a per-request basis by returning a null
            // HttpFilters instance
            if (filter != null) {
                filters.add(filter);
            }
        }
    } else {
        filters = Collections.emptyList();
    }
}
 
Example 3
Source File: BrowserMobHttpFilterChain.java    From AndroidHttpCapture with MIT License 6 votes vote down vote up
public BrowserMobHttpFilterChain(BrowserMobProxyServer proxyServer, HttpRequest originalRequest, ChannelHandlerContext ctx) {
    super(originalRequest, ctx);

    this.proxyServer = proxyServer;

    if (proxyServer.getFilterFactories() != null) {
        filters = new ArrayList<>(proxyServer.getFilterFactories().size());

        // instantiate all HttpFilters using the proxy's filter factories
        for (HttpFiltersSource filterFactory : proxyServer.getFilterFactories()) {
            HttpFilters filter = filterFactory.filterRequest(originalRequest, ctx);
            // allow filter factories to avoid adding a filter on a per-request basis by returning a null
            // HttpFilters instance
            if (filter != null) {
                filters.add(filter);
            }
        }
    } else {
        filters = Collections.emptyList();
    }
}