Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

alternate_cdn is ignored (discussion) #325

Closed

Description

@CSchulz

V. 12.1.0

Running the command with alternate_cdn tries to download the file via the URL defined in config.json:

./node_modules/.bin/webdriver-manager update --gecko=false --standalone=false --alternate_cdn=https://mychromemirror --verbose
https://mychromemirror
ChromeDriver {
  ostype: 'Darwin',
  osarch: 'x64',
  cdn: 'https://mychromemirror',
  configSource:
   ChromeXml {
     ostype: 'Darwin',
     osarch: 'x64',
     out_dir:
      '.../node_modules/protractor/node_modules/webdriver-manager/selenium',
     name: 'chrome',
     xmlUrl: 'https://chromedriver.storage.googleapis.com/' },
  name: 'chromedriver',
  versionDefault: '2.27',
  versionCustom: '2.27' }
[15:40:05] I/downloader - curl -o.../node_modules/webdriver-manager/selenium/chromedriver_2.42.zip https://chromedriver.storage.googleapis.com/2.42/chromedriver_mac64.zip
[15:40:05] I/update - chromedriver: unzipping chromedriver_2.42.zip
[15:40:05] I/update - chromedriver: setting permissions to 0755 for .../node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.42

I think the reason is the missing pass through of the alternate cdn to the config file f.e.

constructor() {
super('chrome', Config.cdnUrls()['chrome']);
}

Activity

  1. cnishina commented on Oct 11, 2018

    @cnishina
    Contributor

    Yes it shouldn't work. I do not have plans to support this... I thought about closing this issue but we should have a discussion about this.

    Do you want to download a file and pass the url directly to webdriver-manager? Do you want something like this?

    webdriver-manager update --alternative_cdn.chrome=http://someurl/chromedriver
    

    Are you using Protractor to use these binaries? How are you starting your selenium server or are you using direct connect? Potentially the flag "alternative_cdn" is the wrong name for this flag.

  2. vort3xxx commented on Oct 16, 2018

    @vort3xxx

    I'm able to point to this guy's alternate cdn and it works for me: https://github.com/JohannesHoppe/webdriver-manager-alternate-cdn

    I think the problem is that your cdn is only the chrome stuff & not all the things that need downloaded in the right structure. Note that his cdn has more than just the chrome stuff hosted.

  3. cnishina commented on Oct 16, 2018

    @cnishina
    Contributor

    Okay. So I have more questions:

    • Is this a good idea from a security standpoint to download binaries that someone says is the binary?
    • Is there no way to get the regular update to work? Is using a proxy an option? If you can use a proxy, can you try https://github.com/cnishina/webdriver-manager-replacement? I have tested the whole thing to work against a proxy (probably needs documentation). I also want to eventually update this project with this. It still works the same where alternative_cdn does not exist.

    Finally is the goal to download files like:

    webdriver-manager update --url.chrome=http://someurl.to.download.chromedriver.directly -- url.standalone=http://someurl.to.download.seleniumserver.directly
    

    I definitely think the flag name should be renamed since it runs a different workflow. Alternative cdn implies that there's an endpoint that has the exact same setup to download a cache of versions and parses the file to find a downloadable version.

    Downloading a file by URL might be helpful because of the way webdriver-manager downloads files. This might be important so it can create the file (in the current project this is update-config.json) required to run directConnect or starting Protractor with a local driverProvider.

  4. changed the title [-]alternate_cdn is ignored[/-] [+]alternate_cdn is ignored (discussion)[/+] on Oct 16, 2018
  5. CSchulz commented on Oct 17, 2018

    @CSchulz
    Author

    I think in a corporate environment you can trust the alternative source for binaries.

    Our workaround is downloading the binary manually:

     mkdir -p node_modules/protractor/node_modules/webdriver-manager/selenium
     curl -o node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_${chromeDriverVersion}.zip ${cdnUrl}/${chromeDriverVersion}/chromedriver_linux64.zip
     cd node_modules/protractor/node_modules/webdriver-manager/
     unzip chromedriver_${chromeDriverVersion}.zip
     chmod 755 chromedriver
    

    And setting the chromeDriver binary in the protractor.conf.js.

  6. hdeadman commented on Oct 25, 2018

    @hdeadman

    The organization I am working at (government) is currently blocking storage.googleapis.com so we are trying to figure out how to work around that. Could these files be packaged into their own NPMs like the selenium-server-standalone-jar NPM? Or could they be downloaded from a site with better content curation (i.e. less likely to be blocked)?

  7. stieler-it commented on Nov 23, 2018

    @stieler-it

    We are hitting GitHub's rate limit after some time which makes our CD pipeline fail. We would really like to place our binaries in our binary repository and download from there. Maybe also a remote (proxy) repository would work so we could at least use a cache.

  8. cnishina commented on Apr 10, 2019

    @cnishina
    Contributor
    • GitHub rate has been fixed. @stieler-it (huzzah!)
    • @hdeadman So if you cannot download to storage.googleapis.com, could you get access via proxy? Packaging binaries in npm would be not ideal. I don't think this is probably good practice.

    So I guess if you had a box externally to your network that did a proxy forward to storage.googleapis.com, you could download from whatever host name you created?

    So instead doing something like:

    curl -o /path/to/downloads/chromedriver.xml https://chromedriver.storage.googleapis.com/
    

    You could call:

    curl -o /path/to/downloads/chromedriver.xml https://myrandomurl.com/
    

    I guess if this is the specific use case, I could maybe create the basic nginx config for this and provide it when you use an an "alternative_cdn". And all the calls would go to (in this example), myrandomurl.com. When calling GitHub, I'm not sure how this will handle the redirects.

    Alternatively, if you did have an externally running job, I would think about running webdriver-manager update and rysnc-ing or copying these files to a local machine.

  9. cnishina commented on Apr 11, 2019

    @cnishina
    Contributor

    Should also look at #300

  10. cnishina commented on Apr 11, 2019

    @cnishina
    Contributor

    Okay after discussion with the team offline, this is not something we will support.

  11. hmil commented on Jul 16, 2020

    @hmil

    May I ask why would you provide the option --alternate_cdn if it doesn't work?

    Isn't it the basic principle of binary repositories to be organized as a star network where each company is supposed to maintain its own private cache of the upstream CDN?

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions