Open legobeat opened 4 days ago
Have a separate http app running on a local socket and have caddy-l4 dial it
- This works fine and is relatively trivial to configure but is inefficient and ugly
A while ago I experimented with making a listener that can "pipe" data directly within the process, without the inefficiencies of re-dialing: https://github.com/caddyserver/caddy/pull/5040
It seems like that would go a long way to fulfilling the feature request?
@mholt Oh yeah, that looks even better, if changes to Caddy itself is on the table!
It is often the case that we want to do some further handling of a request after termination with
caddy-l4
. One example would be using the caddy http module to match on HTTP headers, rewrite URLs, or conditionally forward to different downstreams.We do have some existing overlap of functionality in the
l4.http
module but it doesn't seem desirable to start lifting over further "missing functionality" from caddy into l4, or as a user to fork it for this purpose.Currently, I see two ways to achieve this without modifying caddy-l4:
listener_wrappers
, wrapping downstream listenershttp
app running on a local socket and have caddy-l4dial
itIf
caddy-l4
adds support for aninvoke
handler matching the API of the http app and forwarding to named routes from other apps, it seems that we could get a nice middle-ground option which:listener_wrappers
Possibly at some point later I could take a stab at an early implementation if I could get a sanity-check on the above assumptions and suggested approach.
Related: