/phantomjs

Scriptable Headless WebKit

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

PhantomJS - Scriptable Headless WebKit

PhantomJS (www.phantomjs.org) is a headless WebKit scriptable with JavaScript or CoffeeScript. It is used by hundreds of developers and dozens of organizations for web-related development workflow.

This fork of PhantomJS has modifications to give the invoker more control over DNS lookups.

Usage: phantomjs --dns=/home/user/dns.cfg hello.js http://www.google.com

dns.cfg file format:

google.com = 74.125.224.246,ssl.gstatic.com,
ssl.gstatic.com = 74.125.224.80,gstatic.com,

On the right hand side, the ip is the DNS entry for the hostname. The hostname to right sets the HTTP "Host:" header.

Build:

  • First time compiling run build.sh which will compile QT and PhantomJS. This takes a while.
  • Subsequent changes to PhantomJS can be compiled in with make.

Changes:

  • networkaccessmanager.cpp