chromedrive新增代理支持

This commit is contained in:
Yutousama 2022-04-28 08:23:12 +08:00
parent 7ac9d1b188
commit ec6fce9a8d
2 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication @SpringBootApplication
public class QQBotApplication { public class QQBotApplication {
public static final String version="QQBot v.1.2.22"; public static final String version="QQBot v.1.2.23";
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("version = " + version); System.out.println("version = " + version);
SpringApplication.run(QQBotApplication.class, args); SpringApplication.run(QQBotApplication.class, args);

View File

@ -65,7 +65,11 @@ public class WebClient {
ChromeOptions options = new ChromeOptions(); ChromeOptions options = new ChromeOptions();
// options.addArguments("--disable-gpu"); // options.addArguments("--disable-gpu");
// options.addArguments("blink-settings=imagesEnabled=false"); // options.addArguments("blink-settings=imagesEnabled=false");
String headless = RedisTools.get("headless"); String headless = RedisTools.get("chromedrive_headless");
String proxy=RedisTools.get("chromedrive_proxy");
if("true".equals(proxy)) {
options.addArguments("--proxy-server=http://127.0.0.1:7890");
}
if("true".equals(headless)||WebClient.headless) { if("true".equals(headless)||WebClient.headless) {
options.addArguments("--headless"); options.addArguments("--headless");
} }