Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
defmacro
Sep 27, 2005
cacio e ping pong
There doesn't seem to be a general Ruby thread, so I figured I'd ask my question here.

Is there a quick way in Ruby to create an HTTP proxy server that simply alters the HTML document a bit (going to run a few String#gsub()'s on it is all) before it is returned to the browser? I looked into using WEBrick as Webrick::HTTPProxyServer seemed to be exactly what I was looking for. Poking through the examples/API, I couldn't find a quick way to do something like document_body.gsub(blah, blah2), or even a way to get at the returned document. Googling brought me to mouseHole, but after installing 7 new gems without satisfying all the dependencies, I decided it might be better to try something a little lighter-weight.

Any suggestions?

Adbot
ADBOT LOVES YOU

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply