I'm trying to build a website mirror on my server so that I need to set the host resolver rules by myself. In terminal, I can use this command to redirect it successfully (the chrome knows to load Google from my server):
System.setProperty("webdriver.chrome.driver", "/home/zzy/Downloads/chromedriver");
ChromeOptions options = new ChromeOptions();
options.setBinary("/home/zzy/quic/src/out/Debug/chrome");
options.addArguments("no-sandbox");
options.addArguments("--enable-quic");
options.addArguments("--whitelisted-ips='152.3.144.156'");
options.addArguments("--host-resolver-rules='MAP
www.google.com 152.3.144.156'");
// also not work
// options.addArguments("--no-sandbox", "--enable-quic", "--origin-to-force-quic-on='
www.google.com:80'", "--host-resolver-rules='MAP * 0.0.0.0'");
ChromeDriver driver = new ChromeDriver(options);
// Chrome will go to Google homepage directly without redirecting
Does anyone have insight how to make the option work? Any suggestions are appreciable.