Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
85 lines (52 sloc) 2.84 KB

Go Report Card GoDoc Build Status


Previously known as cdnfinder.js.

Webapp and cli-tool to detect CDN usage of websites. This is the backend for CDNPlanet's CDN Finder tool.

  • Test single hostname or full webpage
  • Automatically downloads the compatible phantomjs executable


TODO: Test on darwin, linux/386, windows

TODO: Binary releases

Docker image


cli: docker run -it turbobytes/cdnfinder cdnfindercli --phantomjsbin="/bin/phantomjs" --full

server: docker run -it turbobytes/cdnfinder cdnfinderserver --phantomjsbin="/bin/phantomjs"

The --phantomjsbin="/bin/phantomjs" portion is important to avoid re-downloading phantomjs each time you launch a container. I will get rid of it in the future using environment variables.

TODO: Install from source




Usage of cdnfindercli:
  -full string
    	URL for full finder
  -host string
    	hostname for single hostname finder
  -phantomjsbin string
    	path to phantomjs, if blank tmp dir is used
  -server string
    	dns server for resolution (default "")

Either -full or -host must be provided


Usage of cdnfinderserver:
  -phantomjsbin string
    	path to phantomjs, if blank tmp dir is used
  -server string
    	dns server for resolution (default "")

The server listens on port 1337 on all interfaces.

Server API

Single host: curl -X POST -d '{"hostname": ""}' -H "Content-Type: application/json"

Full site: curl -X POST -d '{"url": ""}' -H "Content-Type: application/json"

CDN mappings

CNAME mappings are located in assets/cnamechain.json. It is a list of pair of strings where first item is part of the hostname to be matched and the second is the name of the CDN.

To update the list..

  1. Fork this repo
  2. Make your changes to assets/cnamechain.json
  3. Run make test

If all passes, send a pull request. If the nature of the change requires changes in the tests then please do so. Bonus points for expanding on the tests

CDN header detection logic is currently located in headerguess.go. If you have some ideas on how to express as json, I would like to hear about it in issues.

You can’t perform that action at this time.