akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/docs/akka-http
Other
1.34k stars 593 forks source link

Use akka-http to build an HTTP/HTTPs proxy server #1417

Open chenfengyuan opened 7 years ago

chenfengyuan commented 7 years ago

In #1316, akka-http would gracefully reject CONNECT request. If an option that accepts CONNECT is added, users can easily use Http().serverLayer to implement their http proxy.

jrudolph commented 7 years ago

Unfortunately, it's not as easy as that. CONNECT comes with it's own set of semantics. We would have to introduce special support to deal with the intricacies of CONNECT semantics (e.g. does a CONNECT request have a request body? I'd say no, but still it needs to receive data later on. Similarly for the reponse).

I'd say it's mostly out of scope to add this functionality here. I guess it could be simple enough to reuse lots of the internals to build both an HTTP and an HTTPS server but akka-http itself might not be the right place.

chenfengyuan commented 7 years ago

Yes, you are right. As akka-http does not expose most of the internals, I will try to use and modify akka-http source directly.

kbrowder commented 6 years ago

@chenfengyuan did you get anywhere with this?

chenfengyuan commented 6 years ago

@kbrowder no