ルビま!の記事を模写。
Access Logの抑制が間抜けなかんじだなぁ。
#!/usr/bin/env ruby
require 'webrick'
require 'webrick/httpproxy'
include WEBrickh = lambda {|req, res|
}s = HTTPProxyServer.new(
:Port=>8080,
:Logger=>Log.new(nil, Log::ERROR),
:AccessLog=>[ [ File.open("NUL", "w"), AccessLog::COMBINED_LOG_FORMAT ] ],
:ProxyContentHandler=>h
)Signal.trap('INT') {
s.shutdown
}s.start