user670186
user670186

Reputation: 2840

docker selenium remote server how to block or whitelist ips

I set up a docker selenium server for browser testing using docker selenium

I run it with:

docker run -d -p 4444:4444 -e CHROMEDRIVER_WHITELISTED_IPS='123.123.123.123' -v /dev/shm:/dev/shm selenium/standalone-chrome

however, since i cannot bind to 127.0.0.1 , the docker server can be used from external ips as well (not only 123.123.123.123), the whitelist parameter did not werk.

What is a good way to solve this

Upvotes: 1

Views: 3218

Answers (1)

WhoopP
WhoopP

Reputation: 141

I'm not entirely sure of what you are trying to do, but I needed to set the whitelisted-ips parameter to allow all IPs for use with the wdio-devtools-service. In order to do this one needs to pass the whitelisted-ips parameter to chromedriver within the docker container. To do that I started it like this to set the whitelisted-ips to an empty value, which then allows all external IPs:

docker run -d -p 4444:4444 -p 9222:9222 -e JAVA_OPTS="-Dwebdriver.chrome.whitelistedIps=" -v /dev/shm:/dev/shm selenium/standalone-chrome

Upvotes: 4

Related Questions