/genius-dot-codes-proxy

A tiny Ruby proxy server that activates annotations on any web page

Primary LanguageRubyMIT LicenseMIT

The genius.codes proxy

This is a tiny web proxy server that activates Genius annotation on any web page*.

It's written as a demonstration and proof of concept, and is about as far from production-ready as a piece of software could be. But it does look a lot like the first version of the proxy that powers Genius annotations across the web.

This repository serves as the show notes for our presentation at Code Genius, in which we live coded roughly what you see in server.rb.

Video of the presentation

Available on Youtube

Installing and running it

  • Clone the repo
  • Run bundle
  • Run ruby server.rb -s

Using it

You can proxy any page by prefixing its URL with localhost:9000. For instance, to see the annotations on the Tender Love Making blog, point your browser to http://localhost:9000/tenderlovemaking.com.

Technologies

The proxy is written in Ruby; it uses Goliath, a non-blocking Ruby web server; em-synchrony, an extension to EventMachine that lets us write non-blocking code in a familiar linear style using Ruby fibers.

Motivation

Mostly to demonstrate that you don't need Node to write this kind of thing.

Caveats

* Any web page whose head tag starts with the exact string <head>

License

This software is released under the MIT license. See attached LICENSE for details.