How to create an HTTP Proxy?

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.