Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/usr/bin/env ruby
require 'webrick'
require 'webrick/httpproxy'
handler = Proc.new() do |req,res|
if (req.path == '/glm/mmap' and res['content-type'] =~ /binary/) ||
(req.host =~ /^cbk\d+\.google/ and res['content-type'] =~ /jpeg/)
res.body.gsub!(/0/m, rand(10).to_s)
res['cache-control'] = 'no-cache'
end
end
s = WEBrick::HTTPProxyServer.new(
:BindAddress => '0.0.0.0',
:Port => 8080,
:ProxyContentHandler => handler
)
Signal.trap('INT') do
s.shutdown
end
s.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.