Help with HTTP Intercepting Proxy in Ruby?

前端 未结 3 1173
刺人心
刺人心 2021-02-11 02:42

I have the beginnings of an HTTP Intercepting Proxy written in Ruby:

require \'socket\'                # Get sockets from stdlib

server = TCPServer.open(8080)           


        
3条回答
  •  臣服心动
    2021-02-11 03:39

    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.

提交回复
热议问题