3

私はサードパーティのリソースを除外するためにプロキシを使用しています。しかし、私はhttpsで始まるすべてのリソースに問題があります。どんな解決策を提案してもらえますか? たとえば、static.licdn.comをhttp://linkedin.comから除外しようとしています。ステータスは変わりますが、リソースをダウンロードします。BrowserMobプロキシはhttpsリソースをブラックリストに登録しません

public void setUp()  
    throws Exception 
{ 
    setName("test"); 
    try 
    { 
     FirefoxBinary firefoxbinary = new FirefoxBinary(new File("firefoxpath")); 
     File file = new File("profilePath"); 
     FirefoxProfile firefoxprofile = new FirefoxProfile(file); 
     firefoxprofile.setPreference("browser.startup.homepage", "http://www.google.com"); 
     BrowserMobProxyServer server = new BrowserMobProxyServer(); 
     server.start(); 
     ArrayList arraylist = new ArrayList(); 
     arraylist.add(new BlacklistEntry(".*static\\.licdn\\.com.*", 204)); 
     server.setBlacklist(arraylist); 
     org.openqa.selenium.Proxy proxy = ClientUtil.createSeleniumProxy(server); 
     proxy.setSslProxy("localhost:" + server.getPort()); 
     DesiredCapabilities desiredcapabilities = new DesiredCapabilities(); 
     desiredcapabilities.setCapability("proxy", proxy); 
     desiredcapabilities.setCapability("acceptSslCerts", true); 
     driver = new FirefoxDriver(firefoxbinary, firefoxprofile, desiredcapabilities); 
    } 
    catch(Throwable throwable) 
    { 
     LOG.error("Problem in setup: ", throwable); 
    } 
} 
  • ブラウザの暴徒のバージョン:2.1.1
  • セレンバージョン:2.53
  • FFのバージョン:46
+1

あなたが見ている問題は何ですか?ステータスコードは表示されますが、プロキシは引き続きリソースをフェッチしますが、エントリがブラックリストに登録されている場合は、BMPがそれを行うことはできません。 Firefoxのインスタンスはどこで実行されていますか? .createSeleniumProxy()を使用している場合は明示的に.setSslProxy()を呼び出す必要はありませんが、FirefoxをBMPと同じマシン上で実行する必要があることを明示的に「localhost」に設定しています。 –

+0

問題はhttpsリソースに関連しています。償還額がhttpsの場合、それは除外されません – nanukvs

+0

私は別のホストでこの問題を再現しましたが、あなたのものを借りてバグレポートを提出しています:https://github.com/lightbody/browsermob-proxy/issues/509 – jordanpg

答えて

0

ソリューション - 私たちは、サードパーティのLIBSをexludingため、当社独自のプラグインを書きます。残念ながら私はプロジェクトポリシーのためにコードを共有できません。

関連する問題