Windows 10 - chromedriver.exe returns me Only local connections are allowed

14,414

Solution 1

This is from a quote from the official chromedriver website. "By default, ChromeDriver only allows local connections. If you need to connect to it from a remote host, use --whitelisted-ips switch on the command line to specify a list of IP addresses that are allowed to connect to ChromeDriver."

http://chromedriver.chromium.org/security-considerations

In other words, Only local connections are allowed. is supposed to show when running chromedriver if not you want to run it from a remote host.

Solution 2

This error is getting because of Browser Version which you have in your local and chromdriver which you downloaded into the Project.

Cross check your downloaded chromedriver + Browser Version, if there is a deviation please download the one which match's the version you had.

Here is the Link - https://sites.google.com/a/chromium.org/chromedriver/

Solution 3

What you are seeing is not an error. It is an informational message.

When you run this driver, it will enable your scripts to access this and run commands on Google Chrome.

This can be done via scripts running in the local network (Only local connections are allowed.) or via scripts running on outside networks (All remote connections are allowed.). It is always safer to use the Local Connection option. By default your Chromedriver is accessible via port 9515.

See this answer if you wish to allow all connections instead of just local.


If your Chromedriver only shows the above three messages (as per the question), then there is a problem. It has to show a message like this, which says it started successfully.

Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

Step 1: Check your browser version

Open Google Chrome.

Options --> Help --> About Google Chrome

enter image description here

My version is: Version 83.0.4103.61

Step 2: Compare versions of Chromedriver and Google Chrome

Both versions should start with the same number. My browser version is 83, hence, the chrome driver version should also be 83. If your versions mismatch, then you will see the following message. You will not see the line which says, ChromeDriver was started successfully..

Starting ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

Step 3: Download the correct version of Chromedriver

Download the correct version that matches your browser version. Use this page for downloads. To set up this for windows, see this answer. Do step 2 again.

Solution 4

There is no need to have the same version of chromedriver and chrome, I just tried a different version of chromedriver, and the one which was a version older than my chrome worked! ( my chrome was version 91 and my chrome driver was version 90)

Share:
14,414
Iefimenko Ievgen
Author by

Iefimenko Ievgen

Updated on June 07, 2022

Comments

  • Iefimenko Ievgen
    Iefimenko Ievgen almost 2 years

    when I try to run chromedriver.exe last version it returns me the same error message but always with another port:

    Starting ChromeDriver 73.0.3683.20 (8e2b610813e167eee3619ac4ce6e42e3ec622017) on port 64862
    Only local connections are allowed.
    Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
    

    I use Windows 10 Home. Where I can enable it to allow internet connections?