ericmigi
(Eric Migicovsky)
April 11, 2020, 7:42pm
1
Switching from Caddy 1 to 2. It’s not clear to me if the http.proxyprotocol plugin is available in binary form for Caddy 2 yet? Any tips on how to get it to work with Caddy 2?
Thanks!
Most v1 plugins are not available yet for Caddy v2. They need to be ported to v2. There are instructions for how to write v2 plugins and modules here:
Also, there was a feature request to add PROXY protocol here:
opened 03:49PM - 23 Aug 19 UTC
feature
Afaik caddy only supports the proxy protocol in the "frontend" (so another proxy… is connecting using the proxy protocol to caddy). Caddy does not support using the proxy protocol to connect to upstreams, according to the documentation at https://caddyserver.com/docs/proxy:
> to is the destination endpoint to proxy to. ... If a scheme (http/https/quic/srv) ...
It should be possible to use "proxy" as a scheme.
Also, Matt sent a reminder to the author of the v1 plugin that v2 is ready to be ported to here:
opened 03:31AM - 16 Mar 20 UTC
closed 04:29PM - 10 Aug 21 UTC
Hi!
Whenever you're ready, Caddy 2 (still in beta, at time of writing) is now… able to accommodate wrapping listeners. The commit that adds this is https://github.com/caddyserver/caddy/commit/f596fd77bb6880485d2bfc6b18a775b5572da260.
The docs aren't published yet, but basically, [the servers struct in Caddy's JSON](https://caddyserver.com/docs/json/apps/http/servers/) will have a new field called `listener_wrappers` which takes an array of structs. Each struct can configure a different listener wrapper. (Users can even specify which wrappers come before or after the TLS listener, so if a plugin needs to read before the TLS handshake, that's fine too! But by default they go after TLS.)
Listener wrapper modules are in the `caddy.listeners` namespace, so for example: `caddy.listeners.proxy_protocol` might be your module's ID.
The site [has docs for extending Caddy 2](https://caddyserver.com/docs/extending-caddy) but I will be happy to help answer any questions you have in the process!
1 Like
system
(system)
Closed
May 11, 2020, 8:52pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
Since this seems to be a popular link, the Caddy v2 version of the proxyprotocol plugin is here:
Caddyfile support is not yet ready, but it should be soon, likely alongside Caddy v2.3.0, which adds a way to make listener wrappers configurable:
https://github.com/caddyserver/caddy/pull/3836
1 Like