fireprox

A simple proxy for MozRepl over HTTP GET using express/nodejs

npm install fireprox
6 downloads in the last week
13 downloads in the last month
<p>A simple proxy for <a href="https://github.com/bard/mozrepl/wiki">MozRepl</a> over HTTP GET using <a href="https://github.com/visionmedia/express">express</a>/<a href="http://nodejs.org">nodejs</a>,
to control Firefox:</p>

<pre><code>Any browser/client &lt;--&gt; fireprox &lt;--&gt; MozRepl &lt;--&gt; Firefox
</code></pre>

<p>I threw this together because I needed an easy way to programatically read the current
url from Firefox into my javascript web application <a href="http://WhoDoTheyServe.com">WhoDoTheyServe.com</a>,
but was unable to workaround browser security restrictions or get
<a href="http://code.google.com/p/selenium/wiki/FirefoxDriver">Firefox WebDriver</a> to work reliably.</p>

<h2 id="to-install-and-run">To Install and Run</h2>

<p>To install globally:</p>

<pre><code>npm install -g fireprox
</code></pre>

<p>To configure (optional):</p>

<pre><code>export MOZREPL_HOST=&lt;your MozRepl host name or ip, default=localhost&gt;
export MOZREPL_PORT=&lt;your MozRepl port, default=4242&gt;
export FIREPROX_PORT=&lt;Fireprox port, default=8080&gt;
</code></pre>

<p>To start:</p>

<pre><code>cd /usr/lib    (or wherever your global node_modules lives)
npm start fireprox
</code></pre>

<p>If all goes well you should see the MozRepl welcome message.</p>

<h2 id="usage">Usage</h2>

<p>Point any browser/client to <code>http://fireprox:8080/exec/COMMAND</code> where:</p>

<p><code>fireprox:8080</code> is the nodejs server running fireprox</p>

<p><code>COMMAND</code> is any MozRepl command</p>

<h2 id="examples">Examples</h2>

<p>To get the firefox current url, browse to:</p>

<pre><code>http://fireprox:8080/exec/content.location.href
</code></pre>

<p>To show &lsquo;foo&rsquo; in an alert box, browse to:</p>

<pre><code>http://fireprox:8080/exec/alert('foo')
</code></pre>

<p>(note you&rsquo;ll need to manually close this alert before fireprox returns).</p>

<p>To configure for hosting MozRepl at <code>sweep:5050</code> and fireprox on port <code>8181</code>:</p>

<pre><code>export MOZREPL_HOST=sweep
export MOZREPL_PORT=5050
export FIREPROX_PORT=8181
</code></pre>

<h2 id="credits">Credits</h2>

<p>Inspired by <a href="http://www.codediesel.com/tools/peeking-inside-firefox-using-mozrepl">codediesel</a>.</p>

<h2 id="license">License</h2>

<p>MIT</p>

npm loves you