APISonar


com.machinepublishers.jbrowserdriver.ProxyConfig.Type.HTTP

> com > machinepublishers > jbrowserdriver > ProxyConfig > Type > HTTP
com APIs machinepublishers APIs jbrowserdriver APIs ProxyConfig APIs Type APIs HTTP APIs

Example 1
private FutureWithStartTick runWebDriverJava(Constructor<?> defaultConstructor,
            Method testMethod) throws Exception {
        Settings.Builder settings = Settings.builder()
                .requestHeaders(REQUEST_HEADERS)
                .userAgent(userAgent);
        HttpProxyConfig httpProxyConfig = configRepository.getHttpProxyConfig();
        if (!httpProxyConfig.host().isEmpty()) {
            int proxyPort = MoreObjects.firstNonNull(httpProxyConfig.port(), 80);
            settings.proxy(new ProxyConfig(ProxyConfig.Type.HTTP, httpProxyConfig.host(),
                    proxyPort, httpProxyConfig.username(),
                    httpProxyConfig.encryptedPassword()));
        }
        JBrowserDriver driver = new JBrowserDriver(settings.build());
        return runJava(defaultConstructor, testMethod, driver);
    }