From: Nokan Emiro Date: 2010-11-12T04:06:47+09:00 Subject: WEBrick HTTPProxyServer question --0016362845662cd25e0494cbac4a Content-Type: text/plain; charset=UTF-8 Hi, could somebody please show me what can I do to prevent WEBrick::HTTPProxyServer from accessing the webserver on special cases? There are cases when the proxy already knows in the RequestCallback procedure that the content on the webserver is irrelevant to the data sent back to the browser. Think about a http proxy, that has a list of URLs that should be blocked, or think about a caching proxy, that does not need to contact the webserver if the content is already available in the RequestCallback phase: require 'webrick/httpproxy' server = WEBrick::HTTPProxyServer.new( :Port => 8080, :RequestCallback => Proc.new do |req, res| if ## condition ## ## what to do here to prevent http req? ## end end ) server.start What can I do between the "if" and "end" to throw back a content to the browser? For example if I have a $cache, that contains the cached html code: if $cache.has_key?(req.request_uri) # how to send back here $cache[req.request_uri] asap? end -- Thank for Your help, Uzlee --0016362845662cd25e0494cbac4a--