require'net/http'require'uri'proxy_addr='localhost'proxy_port=8118url=URI.parse('http://shlrm.org/baconflowchartvj8.jpg')Net::HTTP::Proxy(proxy_addr,proxy_port).start(url.host)do|request|puts"Connected to teh proxy"# connected to mah proxyto_save=url.path.split(/\//)[-1]File.open("c:\\"+to_save,'wb')do|f|puts"opened file"request.request_get(url.path)do|response|content_length=Integer(response['content-length'])total_count=0response.read_bodydo|str|ifstr.length>0thentotal_count+=str.lengthprint"Complete: #{total_count} of #{content_length}: "puts"%4f"%(1.0*total_count/content_length*100)endf.writestrendendputs"Written file"endputs"done connecting"endputs"all done"