question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set authentication socks proxy on docker Selenium Grid

See original GitHub issue

Thank you very much for developing this library that is so useful ,I’ve used it in a formal project.

Now, I have a question,how to set authentication socks proxy on docker Selenium Grid?

I know of a Remote class,but I don’t know how to configure it

my code :

# coding=utf-8
import time
from seleniumwire import webdriver

chrome_capabilities = {
    "browserName": "chrome",
    "version": "",
    "platform": "ANY",
    "javascriptEnabled": True,
    'applicationName': 'test1'
}

sw_options = {
    'addr': '0.0.0.0',
    'port': 8087,
    'auto_config': False,  # Ensure this is set to False
    'proxy': {
        'http': 'socks5://user:pass@proxy_ip:proxy_port',
        'https': 'socks5://user:pass@proxy_ip:proxy_port'
    }
}



# browser = webdriver.Remote("http://docker_ip:docker_host/wd/hub", desired_capabilities=chrome_capabilities)
browser = webdriver.Remote("http://docker_ip:docker_host/wd/hub", desired_capabilities=chrome_capabilities,
                           seleniumwire_options=sw_options)
browser.get("http://httpbin.org/get")
print(browser.title)
time.sleep(60)
browser.get_screenshot_as_file("8.png")
browser.quit()

it still shows the IP of the real machine and not proxy ip

I try this config:issue220,maybe he used Kubernetes ,and I use doker,so I guess it’s a little different

I have been afraid of confusing you with unclear expressions, so I’m sorry that I edited it for several times

Looking forward to your reply

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Eeyhancommented, Jun 22, 2021

Thanks,Let me try again how to configure it,by the way,this library is really good to use

0reactions
zellsuncommented, May 13, 2022

When I use the real ip 192.168.0.xxx instead of 127.0.0.1 or 0.0.0.0, it works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure special proxy settings for a remote selenium ...
1 Answer 1 · Remove the user/pass from the socks proxy config and add them to your Proxy connection uri. · Use the...
Read more >
HTTP Proxy Authentication with Selenium Webdriver - Tools QA
How to set HTTP Proxy with Username and Password · Type 'about:config' on the browser and press Enter. · The moment you press...
Read more >
How to set proxy in Selenium : Tutorial | BrowserStack
The best way to integrate authenticated proxies with Selenium is by using PhantomJS as a headless browser instead of the Chrome WebDriver.
Read more >
[Code example]-Set proxy.socks.port selenium - appsloveworld
Lets understand first, how FF (or webdriver you use with Selenium) is setting SOCKS proxy. For Firefox, do about:config in URL box. network.proxy.socks;10.10....
Read more >
How to Setup Selenium Grid with BrowserMob-Proxy to pass ...
VP at JPMorgan Chase & Co. · Create docker-compose to run Selenium Grid · Implement BrowserMob-Proxy embedded solution to manipulate selenium http ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found