Quick installation instructions:
- in the unlikely event that you don’t have .NET 4.0 installed, get it from www.microsoft.com/net. WARNING: Needs a reboot
- Download the .NET 4.0 zip file from http://ironruby.codeplex.com/releases/view/25901
- Unzip it somewhere sensible. Mine is in D:JulianDocumentsProjectsIronRuby.
- Add the “bin” folder to your path.
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 = WEBrick::HTTPProxyServer.new(
:Port => 8080,
:BindAddress => ‘0.0.0.0’,
:ServerType => Thread,
:RequestCallback => Proc.new {|request,response| puts “#{request.unparsed_uri}” }
)
server.startputs “Hit return to quit”
STDIN.gets
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.