Proxy Server: Getting IronRuby Working

Quick installation instructions:

Getting the Proxy Server Running

Annoyingly, you need to change the code from the previous post, because I used a 1.9.1 idiom: the new lambda syntax and WEBrick doesn’t seem to work under IronRuby’s 1.9 mode.

require ‘webrick’
require ‘webrick/httpproxy’

server =
    :Port => 8080,
    :BindAddress => ‘’,
    :ServerType => Thread,
    :RequestCallback => {|request,response| puts “#{request.unparsed_uri}” }

puts “Hit return to quit”

Sure enough, the performance is perfectly fine, meaning it’s likely that the whole virtual machine installation is the source of the problems.  This is unfortunate, since that was the purpose of the exercise.  It’s starting to look like I may have to do a full installation onto my computer, which in turn means stopping using Notepad++.

There’s a bit more about WEBrick and proxy servers here, if you can cope with the automatic smiley generator damaging the code.  There’s an MSDN example of a web server as well.

Technorati Tags: ,

Published by

Julian Birch

Full time dad, does a bit of coding on the side.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s