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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: Socks5 Proxy (Chrome) #13820

Open
TurboKoT1 opened this issue Apr 13, 2024 · 2 comments
Open

[馃悰 Bug]: Socks5 Proxy (Chrome) #13820

TurboKoT1 opened this issue Apr 13, 2024 · 2 comments

Comments

@TurboKoT1
Copy link

What happened?

When I connect to a socks5 proxy - I completely lose internet in my browser. The proxy is fully working.

Code:
` ChromeOptions options = new ChromeOptions();

    Proxy proxy = new Proxy();
    proxy.setProxyType(Proxy.ProxyType.MANUAL);
    proxy.setAutodetect(false);

    proxy.setSocksProxy("123.456.789.123:1234");
    proxy.setSocksUsername("username");
    proxy.setSocksPassword("password");
    proxy.setSocksVersion(5);

    options.setCapability("proxy", proxy);

    WebDriver driver = new ChromeDriver(options);
    driver.manage().window().maximize();

    driver.get("http://2ip.io");`

Before that, I tried to use the flags of the browser itself, which also didn't give any result:
` ChromeOptions options = new ChromeOptions();

    options.addArguments("--proxy-server=socks5://123.456.789.123:1234");
    options.addArguments("--proxy-auth=username:password");

    WebDriver driver = new ChromeDriver(options);
    driver.manage().window().maximize();

    driver.get("http://2ip.io");`

How can we reproduce the issue?

First code:
`       ChromeOptions options = new ChromeOptions();

        Proxy proxy = new Proxy();
        proxy.setProxyType(Proxy.ProxyType.MANUAL);
        proxy.setAutodetect(false);

        proxy.setSocksProxy("123.456.789.123:1234");
        proxy.setSocksUsername("username");
        proxy.setSocksPassword("password");
        proxy.setSocksVersion(5);

        options.setCapability("proxy", proxy);

        WebDriver driver = new ChromeDriver(options);
        driver.manage().window().maximize();

        driver.get("http://2ip.io");`
Second code:
`        ChromeOptions options = new ChromeOptions();

        options.addArguments("--proxy-server=socks5://123.456.789.123:1234");
        options.addArguments("--proxy-auth=username:password");

        WebDriver driver = new ChromeDriver(options);
        driver.manage().window().maximize();

        driver.get("http://2ip.io");`

Relevant log output

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
. 13, 2024 10:30:16 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
Exception in thread "Thread-2" org.openqa.selenium.WebDriverException: unknown error: net::ERR_SOCKS_CONNECTION_FAILED
  (Session info: chrome=123.0.6312.122)
Build info: version: '4.19.1', revision: 'abe0ee07dc'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.10'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [45090e2209b99e5d9cfa1fea12a69c0f, get {url===%7D]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 123.0.6312.122, chrome: {chromedriverVersion: 123.0.6312.122 (31f8248cdd9..., userDataDir: C:\Users\SILENC~1\AppData\L...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:52306}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: windows, proxy: Proxy(manual, socks=95.182...., se:cdp: ws://localhost:52306/devtoo..., se:cdpVersion: 123.0.6312.122, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: 45090e2209b99e5d9cfa1fea12a69c0f
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)
        at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)
        at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)
        at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:300)
        at com.turbokot.testselenium.CaptchaProcess.run(CaptchaProcess.java:56)
        at java.base/java.lang.Thread.run(Thread.java:842)

Operating System

Windows 10/11

Selenium version

Java 17, org.seleniumhq.selenium:selenium-java:4.19.1

What are the browser(s) and version(s) where you see this issue?

Chrome 123.0.6312.122 (64聽bit) (cohort: M123 Rollout)

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 123.0.6312.105

Are you using Selenium Grid?

No response

Copy link

@TurboKoT1, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@HakanBi
Copy link

HakanBi commented Apr 14, 2024

I encountered the same problem

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

No branches or pull requests

3 participants