chgeuer

chgeuer

How to create an HTTP Proxy?

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.

I found GitHub - houli/http-proxy: A HTTP(S) Proxy written in Elixir · GitHub (9 years old, work in progress) and GitHub - KazuCocoa/http_proxy: http proxy with Elixir. wait request with multi port and forward to each URIs · GitHub, but there’s no real getting-started sample. Given that a proxy isn’t just a regular web server, I’m not sure this thing can easily be plugged into a web server like Cowboy/Bandit/Phoenix…

Thanks, Christian

First Post!

D4no0

D4no0

How so? The requirements may widely wary, however I can see how you could have a combination of phoenix and a http client.

Most Liked

sorax

sorax

do you know https://github.com/tallarium/reverse_proxy_plug?
we use it for “shielding” an old website and injecting css into the page

kind regards, robert

Last Post!

jstimps

jstimps

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.

Where Next?

Popular in Questions Top

stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New

Other popular topics Top

New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement