3

Some servers can respond to the Via header. For the purity of the experiment, I want to get rid of it. How it can be made using a wrapper on a python for Browsermob-proxy? That it was better understood, I will result the code: Sorry for my English!

    from pyvirtualdisplay import Display
    from selenium import webdriver
    from browsermobproxy import Server

    display = Display(visible=0, size=(1920, 1080)).start()

    server = Server("/path...")
    server.start()
    proxy = server.create_proxy()

    profile  = webdriver.FirefoxProfile()
    profile.set_proxy(proxy.selenium_proxy())
    driver = webdriver.Firefox(firefox_profile=profile)

    proxy.new_har('test', options={'captureHeaders': True})
        ??? proxy.headers(headers = {'Via': ''})

    driver.get("http://headers.cloxy.net/request.php")
    time.sleep(10)

    print(driver.page_source)

    server.stop()
    driver.quit()
    display.stop()
Dmitriy
  • 31
  • 1

1 Answers1

0

Allowing users to remove 'via' header is a current issue.

However the full source is available on github. I managed to get rid of the via header by removing line 274 of LittleProxy/ProxyUtils.java, then having my project use my local copy of browsermob-core which uses my local copy of LittleProxy.

dustytrash
  • 1,519
  • 1
  • 8
  • 14