I have the beginnings of an HTTP Intercepting Proxy written in Ruby:
require \'socket\' # Get sockets from stdlib
server = TCPServer.open(8080)
WEBrick is blocking I/O ... This mean it does not able to stream the response. For example if you go on a youtube page to see a video, the stream will not be forwarded to your browser until the proxy have downloaded all the video cotent. If you want the video be played in your browser during it download, you have to look for a non blocking I/O solution like EventMachine. For HTTPS the solution is a little bit complicated since you have to develop a man in the middle proxy.