Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jbrowserdriver - remote - proxy #239

Open
walterjwhite opened this issue Jan 15, 2017 · 4 comments
Open

jbrowserdriver - remote - proxy #239

walterjwhite opened this issue Jan 15, 2017 · 4 comments
Labels

Comments

@walterjwhite
Copy link

I am setting the necessary proxy (for traffic to be routed) in desired capabilities, but jbrowser driver appears to ignore those settings when I run it as a remote driver.

@walterjwhite
Copy link
Author

I tried:

  1. setting the system proxy on the command line where I'm starting the driver
  2. setting capabilities
  3. setting system properties where I'm initializing the remote web driver instance (I know, this was just a last ditch effort).

None of the above had any impact.

Thanks,

Walter

@GrzegorzDrozd
Copy link

I also have this problem. I tried everything I could think of:

DesiredCapabilities cap = new DesiredCapabilities();
Proxy proxy = new Proxy();
proxy
        .setHttpProxy("127.0.0.1:8181")
        .setFtpProxy("127.0.0.1:8181")
        .setSslProxy("127.0.0.1:8181")
        .setSocksProxy("127.0.0.1:8181")
        .setProxyType(Proxy.ProxyType.MANUAL);
        cap.setCapability(CapabilityType.PROXY, proxy);
return new JBrowserDriver(cap);
DesiredCapabilities cap = new DesiredCapabilities();
Proxy proxy = new Proxy();
proxy
        .setSocksProxy("127.0.0.1:8181")        
        .setProxyType(Proxy.ProxyType.MANUAL);
        cap.setCapability(CapabilityType.PROXY, proxy);
return new JBrowserDriver(cap);

Produces right away : org.openqa.selenium.WebDriverException: org.openqa.selenium.Proxy
Caused by: java.io.NotSerializableException: org.openqa.selenium.Proxy

And any combination of:

Settings.Builder settings = Settings.builder();
settings.userAgent(UserAgent.CHROME);
settings.timezone(Timezone.EUROPE_LONDON);

ProxyConfig config = new ProxyConfig(ProxyConfig.Type.SOCKS, "localhost", 8181);
settings.proxy(config);
return new JBrowserDriver(settings.build());

With or without:

System.setProperty("socksProxyHost", "localhost");
System.setProperty("socksProxyPort", "8181");

System.setProperty("jbd.proxyhost", "localhost");
System.setProperty("jbd.proxyport", "8181");
System.setProperty("jbd.proxytype", ProxyConfig.Type.SOCKS.toString());

Creates timeouts because url I am trying to load is accessible only using proxy.
Please fix that.

@GrzegorzDrozd
Copy link

Stack trace for serialization error:
https://gist.github.com/GrzegorzDrozd/ce0b8fa74de1a18bdad0e7a82d4b9f01

@GrzegorzDrozd
Copy link

It fails :/

Settings.Builder settings = Settings.builder();
settings.proxy(new ProxyConfig(ProxyConfig.Type.SOCKS, "localhost", 8181));
settings.userAgent(UserAgent.CHROME);
settings.timezone(Timezone.EUROPE_LONDON);

driver = new JBrowserDriver(settings.build());

Fails with exception: https://gist.github.com/GrzegorzDrozd/4c0ea0a338e9ec25d715dad1892bc58a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants