You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Putting caddy-l4 in listener_wrappers, wrapping downstream listeners
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
If caddy-l4 adds support for an invoke 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:
matches Caddy API
is relatively less complex than using listener_wrappers
shouldn't need accommodating for protocol particularities or larger changes in caddy-l4
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.
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: caddyserver/caddy#5040
It seems like that would go a long way to fulfilling the feature request?
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:
The text was updated successfully, but these errors were encountered: