SeleniumHQ / SeleniumHQ/docker-selenium
[🐛 Bug]: Unable to use socks5 proxy
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.7k
- Forks
- 2.5k
- Avg merge
- 10h 16m
- Merged PRs (30d)
- 20
Description
What happened?
opt_einsum = webdriver.ChromeOptions()
opt_einsum.set_capability('browserVersion', '127.0')
proxy = "xxx:x"
opt_einsum.add_argument(f'--proxy-server=socks5://{proxy}')
opt_einsum.add_argument(f'--proxy-auth=xxx:xxx')
print(opt_einsum)
Command used to start Selenium Grid with Docker (or Kubernetes)
opt_einsum = webdriver.ChromeOptions()
opt_einsum.set_capability('browserVersion', '127.0')
proxy = "xxx:x"
opt_einsum.add_argument(f'--proxy-server=socks5://{proxy}')
opt_einsum.add_argument(f'--proxy-auth=xxx:xxx')
print(opt_einsum)
Relevant log output
Traceback (most recent call last):
File "/Users/chenp/Library/Application Support/JetBrains/IntelliJIdea2022.3/plugins/python/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Users/chenp/Library/Application Support/JetBrains/IntelliJIdea2022.3/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/chenp/btcweb/cf/selenium_get.py", line 35, in <module>
session.get("https://api.ipify.org/")
File "/opt/homebrew/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 363, in get
self.execute(Command.GET, {"url": url})
File "/opt/homebrew/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
self.error_handler.check_response(response)
File "/opt/homebrew/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: net::ERR_SOCKS_CONNECTION_FAILED
(Session info: chrome=127.0.6533.119)
Stacktrace:
#0 0x56179ac936ca <unknown>
#1 0x56179a964600 <unknown>
#2 0x56179a95c631 <unknown>
#3 0x56179a94c839 <unknown>
#4 0x56179a94e5c4 <unknown>
#5 0x56179a94cb05 <unknown>
#6 0x56179a94c35f <unknown>
#7 0x56179a94c252 <unknown>
#8 0x56179a94a56c <unknown>
#9 0x56179a94a8ea <unknown>
#10 0x56179a966f21 <unknown>
#11 0x56179a9f5b45 <unknown>
#12 0x56179a9d68a2 <unknown>
#13 0x56179a9f504a <unknown>
#14 0x56179a9d6643 <unknown>
#15 0x56179a9a6d31 <unknown>
#16 0x56179a9a779e <unknown>
#17 0x56179ac5b25b <unknown>
#18 0x56179ac5f1f2 <unknown>
#19 0x56179ac48615 <unknown>
#20 0x56179ac5fd82 <unknown>
#21 0x56179ac2d25f <unknown>
#22 0x56179ac82e68 <unknown>
#23 0x56179ac83040 <unknown>
#24 0x56179ac9249c <unknown>
#25 0x7f8d74c3aa94 <unknown>
Operating System
mac
Docker Selenium version (image tag)
selenium/node-chrome:4.23.1-20240820
Selenium Grid chart version (chart version)
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the shown ChromeOptions configuration with selenium/node-chrome:4.23.1-20240820 and the reported authenticated SOCKS5 proxy, then inspect the docker-selenium proxy and networking configuration. Done means a Chrome session can load https://api.ipify.org/ through the configured SOCKS5 proxy without ERR_SOCKS_CONNECTION_FAILED.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- infrastructure, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100