Which library / approach would be advisable for building an MITM-style HTTP(s) Proxy, i.e. for intercepting outgoing web traffic? Effectively inspect (and do side effects) based on outgoing traffic.
Thanks @sorax . I had a look at that, but it seems targeted as “reverse proxy”, like NGINX, right? That looked like a component I can put in front of my web server application, and route incoming requests different ways, like an API Gateway.
I’m looking for a component used by a web browser, before going out to the Internet. Is reverse_proxy_plug usable for that, too? The proxy protocol looks slightly different than HTTP
Fully agree that I want the proxy server to run on a solid foundation (like Phoenix). The thing that’s unclear is how to host a component that talks the proxy protocol to the client, instead of plain HTTP.
Thanks for the link, wasn’t aware of the search capabilities of elixir-toolbox.dev… However, as far as I can see, all these are either proxies for special protocols (SIP, Kafka, Telegram MProto) or are ‘reverse proxies’ (like nginx).
I guess the confusion is reverse_proxy_plug could be considered a forward proxy given that it would be used to access an external website. However, it can still be considered a “reverse proxy” between the user & the elixir server.
It sounds like you’re looking for an http server that supports the CONNECT protocol, such as the standalone app squid.
I haven’t personally seen any Erlang or Elixir http servers that have explicit documented support of HTTP CONNECT for proxying, but cowboy does appear to support enable_connect_protocol for Websockets on HTTP2. Might take a bit of experimentation with cowboy’s configuration to determine if it suits your need.