0.0.9 • Published 10 years ago

phantomjs-remote v0.0.9

Weekly downloads
1
License
BSD
Repository
-
Last release
10 years ago

phantomjs-remote

Run PhantomJS scripts on a remote server (e.g. if the phantomjs binary is not available on the local system, like a PaaS virtual machine with an unsupported architecture for phantomjs node wrapper.)

This is my first node.js script, go easy on me :)

Usage

var phantomjs_remote = require('phantomjs-remote');
phantomjs_remote.send(phantomJsScript, callback, [options], [host], [port]).

options is an optional JSON dictionary with any required options, for now only load-images is supported, e.g. { 'load-images': 'no' }.

The last two options may be ommitted if PHANTOMJS_REMOTE environment variable is set with "host:port".

Short example:

phantomjs_remote('console.log(1); phantom.exit();', function(error, result) {
	if (!error)
		console.log(result);
}, { 'load-images': 'no'} );

Server script / SECURITY

You are advised against running this script on it's own and should instead:

  1. Run it in a chroot jail
  2. Firewall the port to only receive connections from trusted hosts

Anyways, run like this:

node phantom-server.js <listenPort>

or

while `true`; do node phantom-server.js <listenPort> ; done 
0.0.9

10 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago