fireprox

A simple proxy for MozRepl over HTTP GET using express/node.js to control Firefox

A simple proxy for MozRepl over HTTP-GET using express/node.js to control Firefox:

browser or client <--HTTP-GET--> fireprox <----> MozRepl + Firefox

I threw this together because I needed an easy way to programatically read the current url from a remote Firefox into my javascript web application but was unable to workaround browser security restrictions or get Firefox WebDriver to work reliably.

$ npm install fireprox
$ cd node_modules/fireprox
$ node fireprox
$ node fireprox --help
Usage: fireprox [options]

Options:

  -h, --help             output usage information
  -V, --version          output the version number
  -p, --port [port]      fireprox listening port (default:8080)
  --mozrepl-host [host]  mozrepl hostname or ip-address (default:localhost)
  --mozrepl-port [port]  mozrepl port (default:4242)

Navigate to http://server:8080 where server is the node.js server running fireprox. You should see Fireprox says hello!.

Now navigate to http://server:8080/COMMAND where COMMAND is any MozRepl command.

To get the firefox current url browse to http://server:8080/content.location.href

To navigate firefox to http://bar browse to http://server:8080/content.location.href='http:%2f%2fbar' (notice the escaped //)

To show foo in an alert box browse to http://server:8080/alert('foo') (you'll need to manually close this alert before fireprox returns).

$ git clone git@github.com:dizzib/fireprox.git

$ npm install -g livescript   # ensure livescript is installed globally
$ ./task/bootstrap            # compile the task runner and install dependencies
$ node dist/task/repl         # launch the task runner
fireprox > b.fc               # compile everything

$ node dist/site/server       # run it!

Inspired by codediesel.

MIT