Tape Your Stuff to the Web
April 7, 2009
I work on a lot of JavaScript projects that make heavy use of AJAX. Most of these need no server infrastructure except reverse proxies (due to JavaScript’s same origin policy). I got tired of setting up nginx configuration files, so I wrote a simple Web server that publishes the current directory to the Web along with reverse proxies. I call it Tape because I use it to tape my stuff to the Web.
Tape is extremely easy to use. Just type tape
, and the current
directory is accessible via http://localhost:8273
(8273 for
t-a-p-e). Want to proxy your local
BOSH connection manager? Type
tape -P /xmpp-httpbind=http://localhost:5280/xmpp-httpbind
and go!
You can also drop a .taperc
file with proxy information into the
current directory and Tape will use that so you don’t have to type
much.
Tape is inspired by SproutCore’s
sc-server
command. While reading the change logs for SproutCore, I
noticed that this command recently got reverse proxy support. That
seemed like it would be incredibly useful for me, and Tape was born.
Tape is written in Python and makes use of Twisted’s Web server features. It clocks in at a little over 150 lines of code.
This is going to my make development work flow so much simpler. I hope it will help you as well.