# phantomjs-remote

> Run PhantomJS scripts on a remote server

Latest version **0.0.9** (published 2014-10-29) · BSD license · 0 weekly downloads

## Install

```sh
npm install phantomjs-remote
pnpm add phantomjs-remote
yarn add phantomjs-remote
bun add phantomjs-remote
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2014-10-29 |
| First published | 2013-07-07 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Gadi Cohen |
| Maintainers | gadicohen |
| Keywords | phantomjs |

## Links

- npm: https://www.npmjs.com/package/phantomjs-remote
- Repository: http://github.com/gadicohen/phantomjs-remote
- Issues: https://github.com/gadicohen/phantomjs-remote/issues
- npm.io page: https://npm.io/package/phantomjs-remote

## Dependencies (1)

- [net](https://npm.io/package/net.md) 1.0.0

## Recent versions

- 0.0.9 (latest) — 2014-10-29
- 0.0.8 — 2013-07-07
- 0.0.7 — 2013-07-07
- 0.0.6 — 2013-07-07
- 0.0.5 — 2013-07-07
- 0.0.4 — 2013-07-07
- 0.0.3 — 2013-07-07
- 0.0.2 — 2013-07-07
- 0.0.1 — 2013-07-07

## README

## phantomjs-remote

Run [PhantomJS](http://phantomjs.org/) 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](https://github.com/Obvious/phantomjs).)

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

## Usage

```js
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:
```js
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:

```bash
node phantom-server.js <listenPort>
```

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

---
_Source: https://npm.io/package/phantomjs-remote · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
