Skip to content

Instantly share code, notes, and snippets.

@seleniumgists seleniumgists/file.m
Created May 13, 2019

Embed
What would you like to do?
generated automatically from #selenium on seleniumhq slack
private static Proxy proxySettings() {
BrowserMobProxy browserMobProxy = getProxy();
if(browserMobProxy.isStarted()) {
String proxyHost = System.getProperty("proxy.host", "");
Proxy proxy;
if(proxyHost.isEmpty()) {
if(runningUsingDocker()) {
proxyHost = "host.docker.internal";
String proxyString = proxyHost + ":" + browserMobProxy.getPort();
proxy = new Proxy();
proxy.setHttpProxy(proxyString);
proxy.setSslProxy(proxyString);
} else {
proxy = createSeleniumProxy(browserMobProxy);
}
} else {
proxy = new Proxy();
String proxyString = proxyHost + ":" + browserMobProxy.getPort();
proxy.setHttpProxy(proxyString);
proxy.setSslProxy(proxyString);
}
return proxy;
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.