klzgrad / naiveproxy

Make a fortune quietly
BSD 3-Clause "New" or "Revised" License
6.6k stars 879 forks source link

Can you provide caddy v1 with naive? #556

Closed U201413497 closed 1 year ago

U201413497 commented 1 year ago

excuse me. The project linked with https://github.com/klzgrad/forwardproxy doesn't provide the option for the Issue, can you provide a version of caddy compiled with naive plugin using caddy v1? It is too complicated to configure multi-users in caddy v2. Thank you so much.

zedifen commented 1 year ago

May I know what is your multi-user configuration like exactly, and why would it be complex in caddy v2? 😊 I think some examples may help others understand the situation, so that they can consider on the necessity to add support for caddy v1.

U201413497 commented 1 year ago

caddy v1 like this,basicauth add username1 and password1,add username2 and password2,it works

domain.com:8443 { tls /path/certificate.crt /path/private.key forwardproxy { basicauth username1 password1 basicauth username2 password2 hide_ip hide_via probe_resistance secert.localhost upstream http://127.0.0.1:8080 } proxy / https://example.com }

caddy v2 like this,all content of the forward_proxy module needs to be refilled. :443, domin.com tls example@example.com route { forward_proxy { basic_auth username1 password1 hide_ip hide_via probe_resistance } forward_proxy { basic_auth username2 password2 hide_ip hide_via probe_resistance } reverse_proxy https://example.com { header_up Host {upstream_hostport} header_up X-Forwarded-Host {host} } }

so caddy v1 just adds username and password in basicauth, it is simple.

zedifen commented 1 year ago

Thanks for your sharing! I tested on my machine and the current version does fail to read and apply multiple user credentials.

It looks like the upstream forwardproxy is said to be supporting multi-user configuration in its README, but actually lacks it. I think we could fix the forwardproxy module than building for caddy v1, since supporting a legacy version usually needs extra efforts, although I have to admit that it may take some time for the upstream to fix the issue.

P.S. For ones who might be interested:

klzgrad commented 1 year ago

There is no plan to support this setup with Caddy v1.

klzgrad commented 7 months ago

Multiple auth is fixed here https://github.com/klzgrad/forwardproxy/releases/tag/v2.7.6-naive