Help with HTTP Intercepting Proxy in Ruby?

前端 未结 3 1174
刺人心
刺人心 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:23

    First, you would probably be better off building on an existing Ruby HTTP proxy implementation. One such is already available in the Ruby standard library, namely WEBrick::HTTPProxyServer. See for example this related question for an implementation based on that same class: Webrick transparent proxy.

    Regarding proxying HTTPS, you can't do much more than just pass the raw bytes. As HTTPS is cryptographically protected, you cannot inspect the contents at the HTTP protocol level. It is just an opaque stream of bytes.

提交回复
热议问题