Giter Site home page Giter Site logo

huylvt / cdnfinder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from turbobytes/cdnfinder

1.0 1.0 0.0 34 KB

Webapp and cli-tool to detect CDN usage of websites.

Home Page: http://www.cdnplanet.com/tools/cdnfinder/

License: MIT License

Makefile 1.69% JavaScript 14.14% Go 84.17%

cdnfinder's Introduction

Go Report Card GoDoc Build Status

cdnfinder

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

Install

TODO: Test on darwin, linux/386, windows

TODO: Binary releases

Docker image

turbobytes/cdnfinder

cli: docker run -it turbobytes/cdnfinder cdnfindercli --phantomjsbin="/bin/phantomjs" --full http://www.cdnplanet.com/

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

TODO

cdnfindercli

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 "8.8.8.8:53")

Either -full or -host must be provided

cdnfinderserver

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

The server listens on port 1337 on all interfaces.

Server API

Single host: curl -X POST -d '{"hostname": "st.cdnplanet.com"}' -H "Content-Type: application/json" http://127.0.0.1:1337/hostname/

Full site: curl -X POST -d '{"url": "http://www.turbobytes.com"}' -H "Content-Type: application/json" http://127.0.0.1:1337/

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.

cdnfinder's People

Contributors

sajal avatar

Stargazers

Roman avatar

Watchers

Huy Le Viet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.